Click here to Skip to main content
15,903,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have written the code in abc.cshtml page.Here i am getting formName,fieldId,pType and finalMsg.

var pg = HttpContext.Current.CurrentHandler;

pg.RegisterStartupScript("abc", "<script type='text/javascript'>
createErrorSpace('" + formName.ToString() + "','" + fieldId.ToString() + "','" + pType.ToString() + "','" + finalMsg.ToString() + "')
</script>");


createErrorSpace is written in config.js file.

But I am getting error here so help me its urgent for me??

Thanks-
Posted
Comments
Snesh Prajapati 14-Mar-14 3:27am    
Can you write the code how are you getting formName,fieldId,pType and finalMsg?

1 solution

I have some good examples in my next article: Advanced ASPX GridView Pagination and Data Entities[^]

Read the article first, then look also in the source code at the method _saveButton_Click() of the class ContactPage.

In your master page (or page layout) or page you have to include the refrenece to your .js file like in the next example:
XML
<script src="/Scripts/config.js" type="text/javascript"></script>
 
Share this answer
 
v3
Comments
AshishvermaMCA 14-Mar-14 5:53am    
This article is not clear my doubt.
Raul Iloc 14-Mar-14 12:28pm    
See my update!

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