I am not sure of the approach

  • Thread starter Thread starter Steve Westwood
  • Start date Start date
S

Steve Westwood

I have a WebForm button. Depending on calculation I wont to send a popup
message to the web page. I am not sure of the approach. From the server
side code I don't seem to be able to access the client side script. Can
anyone help?



I am using the VS .net C# environment
 
Window.Open should send a popup (unless you mean a net send popup) or you
cna use Javascript Alert to send a messagebox.

Does it matter where it's sent from?
 
Steve Westwood said:
I have a WebForm button. Depending on calculation
I wont to send a popup message to the web page. I
am not sure of the approach. From the server side
code I don't seem to be able to access the client side
script. Can anyone help?

You can use a Literal control to insert client-side script into a page.

private void Button_Click(object sender, System.EventArgs e)
{
Literal1.Text = "<script>alert('You clicked me.');</script>";
}

P.
 
this.RegisterStartupScript("something", "<SCRIPT
language='Javascript'>window.alert('Hi!');</SCRIPT>");
-mike
MVP
 
Back
Top