Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my code is below.

I have a session passed to a javascript alert box, the session contains a list of names.
i would like to have a button next to each name that when i click it, it deletes that item in the session. could i insert some kind of button script in the session? with an onclick?!

is it even possible, what are alternative methods. thanks so much guys really really appreciate the help.

MY CODE HERE

VB
Dim message As String = "alert('" + Session("linkedSP").ToString() + "')"
        ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", message, True)


What I have tried:

I have not tried anything yet! becs the code i tried wouldnt build.
VB
Dim message As String = "alert('" + Session("linkedSP").ToString() + "')"
        ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", message, True)
Posted
Updated 5-Apr-18 5:29am
v3

1 solution

First, you should generate and test your HTML as HTML - then incorporate it into your exe. If you're working on the web, however, you'd be well advised to learn javascript and php. They're designed for it and make many things extra easy.

As for your alert - these are text-only items in general. Not even HTML text, but more like regular text (newline character is not <br> !) Now there could be variations across languages, but don't kill yourself getting around something like this.

What to do? Again, from an HTML point of view, create a <div> that you populate with your values and controls. It can be hidden or visible, and that will give you that alert() type appearance, toggling it's visibility attribute (or style). If in other languages, it could be an another window (MDI). The updating process will look really nice if you use AJAX for the button-click removals.

This is also better in that you can now user readable fonts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900