.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

how to show a value in alert message box in asp.net

Posted By: susant     Posted Date: September 29, 2008    Points:2   Category :ASP.Net
hi
i have one code like
page_load event...
{
Response.Write("<script>alert('Hi');</script>");
}

Its working fine...
my requirement...

suppose i declare one variable like that..

int i=10;
Here now I need to show i value in alert message so, How can I Display ?..

I need help can anyone can help...
susantaown@gmail.com
ThanX..

Responses
Author: Amit Mehra             
Posted Date: September 29, 2008     Points: 5   

Hi,
Try like this


int i = 10;
Response.Write("<script>alert('"+i.ToString()+"');</script>");


Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Ruchi             
Posted Date: November 06, 2008     Points: 5   

Response.Write("<script>alert(i);</script>");

Author: Anil Kumar pandey             
Posted Date: January 13, 2009     Points: 5   

hi,
Susant

u can refer the following code for this.


int Anil = 007;
Response.Write("<script>alert('" + i.ToString() + "');</script>");


This will do the job..


Thanks
Anil Pandey

Thanks & Regards

Anil Kumar Pandey


MVP Visual C#(2009-2011)
Author: Athira Sreejith             
Posted Date: April 01, 2009     Points: 5   

Hi..

string Script = "alert('" + i.ToString() + "');";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), Script, true);



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend