Java script in client level
-
Hi Experts, I am showing a alert in code level like, Page.RegisterStartupScript("Error", "<script language=javascript> alert('Error while validating the imported CRF Mapping excel! Check the imported file for more Error Messages ');</script>"); My requirement is, i want to generate a excel file after clicking ok button in the alert but when i write the code below the RegisterStartupScript then both the alert and then file generation is done at the same time. I want to generate the file only after i click ok in alert. Any sugession are highly appreciated!!!!!!!
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
Hi Experts, I am showing a alert in code level like, Page.RegisterStartupScript("Error", "<script language=javascript> alert('Error while validating the imported CRF Mapping excel! Check the imported file for more Error Messages ');</script>"); My requirement is, i want to generate a excel file after clicking ok button in the alert but when i write the code below the RegisterStartupScript then both the alert and then file generation is done at the same time. I want to generate the file only after i click ok in alert. Any sugession are highly appreciated!!!!!!!
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
What is the error you are getting? I would suggest, instead of using RegisterStartupScript, use alert on client side event only. And onClick of "Ok" from alert, post back to the server and generate the excel file. Is it helping you? If not, please elaborate your question.
Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life.
My latest article: Group GridView Data -
Hi Experts, I am showing a alert in code level like, Page.RegisterStartupScript("Error", "<script language=javascript> alert('Error while validating the imported CRF Mapping excel! Check the imported file for more Error Messages ');</script>"); My requirement is, i want to generate a excel file after clicking ok button in the alert but when i write the code below the RegisterStartupScript then both the alert and then file generation is done at the same time. I want to generate the file only after i click ok in alert. Any sugession are highly appreciated!!!!!!!
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
AS the reason of page life cycle of asp.net, so if you generate the excel file in the backend using C#,it will works out the excel first then the alert. you needn't put the alert phrase into the backend,just write it on the frontend , using a function to to represent it,alertme for example , then in the asp.net button ,you just register the following code : onclientclick="alertme();" best regards...thx
I can do!
-
Hi Experts, I am showing a alert in code level like, Page.RegisterStartupScript("Error", "<script language=javascript> alert('Error while validating the imported CRF Mapping excel! Check the imported file for more Error Messages ');</script>"); My requirement is, i want to generate a excel file after clicking ok button in the alert but when i write the code below the RegisterStartupScript then both the alert and then file generation is done at the same time. I want to generate the file only after i click ok in alert. Any sugession are highly appreciated!!!!!!!
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
Did you mean to use
confirm
instead ofalert
? Use a hidden field to store a flag variable, After the alert statement (orconfirm
as the case may be), set the flag and submit the page using JavaScript (window.forms[0].submit). In the code behind Page_Load event, check for the flag and generate the file.