Click here to Skip to main content
15,888,106 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to block the View Source Pin
Jesse Squire4-Jul-06 4:35
Jesse Squire4-Jul-06 4:35 
Question"start the web server before proceding" Pin
ravikiranreddydharmannagari4-Jul-06 2:17
ravikiranreddydharmannagari4-Jul-06 2:17 
AnswerRe: "start the web server before proceding" Pin
Paddy Boyd4-Jul-06 2:18
Paddy Boyd4-Jul-06 2:18 
GeneralRe: "start the web server before proceding" Pin
Paddy Boyd4-Jul-06 2:19
Paddy Boyd4-Jul-06 2:19 
QuestionRe: "start the web server before proceding" Pin
ravikiranreddydharmannagari4-Jul-06 2:34
ravikiranreddydharmannagari4-Jul-06 2:34 
QuestionRe: "start the web server before proceding" Pin
ravikiranreddydharmannagari4-Jul-06 2:42
ravikiranreddydharmannagari4-Jul-06 2:42 
AnswerRe: "start the web server before proceding" Pin
Paddy Boyd4-Jul-06 5:34
Paddy Boyd4-Jul-06 5:34 
QuestionMessage Box using Java Script Pin
psmukil4-Jul-06 1:00
psmukil4-Jul-06 1:00 
Hi all,

Im using C# as my code behind, im having a code in the button click event where im checking whether a file is exists, if it exists then it show the confirmation message box like "file found, want to continue", but its happening if we register the script in the page load and its not checking the condition. By clciking the button itself its showing the message box.



i need that script should get pop up only after the condition get satisfied. Is it possible? Please help me out to solve this problem. Thanks a lot in advance.

The code is given below

private void Page_Load(object sender, System.EventArgs e)

{

i = "file Exists";

StringBuilder str = new StringBuilder();

str.Append("");

str.Append("function PopWindow()");

str.Append("{");

str.Append("alert('hello world')");

str.Append("}");

str.Append("");

if(!Page.IsClientScriptBlockRegistered("clientscript"))

{

Page.RegisterStartupScript("clientscript",str.ToString());

}

Button1.Attributes.Add("onclick","PopWindow();");

}

private void Button1_Click(object sender, System.EventArgs e)

{

if (i=="file Exists")

{

int x= 0;

int y =0;

x = x+ y;

Button1.Attributes.Add("onclick","PopWindow();");

int a = 2;

int z = 2;

z = z+ a;

Response.Write(z.ToString());

}

}

Regards

Mukilan.


REgards
Mukilan
AnswerRe: Message Box using Java Script Pin
Mircea Grelus4-Jul-06 1:30
Mircea Grelus4-Jul-06 1:30 
GeneralRe: Message Box using Java Script Pin
psmukil4-Jul-06 2:07
psmukil4-Jul-06 2:07 
GeneralRe: Message Box using Java Script Pin
Paddy Boyd4-Jul-06 2:22
Paddy Boyd4-Jul-06 2:22 
AnswerRe: Message Box using Java Script [modified] Pin
Guffa4-Jul-06 2:27
Guffa4-Jul-06 2:27 
GeneralRe: Message Box using Java Script Pin
Mircea Grelus4-Jul-06 2:34
Mircea Grelus4-Jul-06 2:34 
QuestionGOOGLE Pin
MHASSANF4-Jul-06 0:59
MHASSANF4-Jul-06 0:59 
QuestionBackcolor for separate rows DataRow in Datatable in C# Pin
michaeil4-Jul-06 0:29
michaeil4-Jul-06 0:29 
AnswerRe: Backcolor for separate rows DataRow in Datatable in C# Pin
Tirthadip4-Jul-06 1:22
Tirthadip4-Jul-06 1:22 
QuestionIntranet and Internet site Pin
SatyajitV4-Jul-06 0:29
SatyajitV4-Jul-06 0:29 
QuestionEncode & Decode in ASP.NET Pin
leanhsang4-Jul-06 0:12
leanhsang4-Jul-06 0:12 
AnswerRe: Encode & Decode in ASP.NET Pin
Guffa4-Jul-06 0:52
Guffa4-Jul-06 0:52 
AnswerRe: Encode & Decode in ASP.NET Pin
Sushant Duggal4-Jul-06 2:21
Sushant Duggal4-Jul-06 2:21 
QuestionHow to convert xml document to word document in asp.net Pin
BalasahebK4-Jul-06 0:00
BalasahebK4-Jul-06 0:00 
AnswerRe: How to convert xml document to word document in asp.net Pin
minhpc_bk4-Jul-06 16:19
minhpc_bk4-Jul-06 16:19 
QuestionTab Control Pin
Brendan Vogt3-Jul-06 23:51
Brendan Vogt3-Jul-06 23:51 
AnswerRe: Tab Control Pin
Mircea Grelus4-Jul-06 1:05
Mircea Grelus4-Jul-06 1:05 
GeneralRe: Tab Control Pin
Brendan Vogt4-Jul-06 3:37
Brendan Vogt4-Jul-06 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.