Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Learning to use JavaScript with ASP.Net
Message
From
21/05/2009 16:00:45
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
Application:
Web
Miscellaneous
Thread ID:
01400821
Message ID:
01401426
Views:
52
>>
>>// Check if script is registered
>>if (!csm.IsStartupScriptRegistered(csType, csName))
>>{
>> string csScript = string.Format("EditAfterNew('{0}');", this.grdTrucks.ClientID);
>> Page.ClientScript.RegisterClientScriptBlock(csType, csName, csScript, true);
>>}
>>
>>
>>Is there any way to get a reference and pass that parameter? Or alternatively is there a way to obtain it within the function without it being passed in?
>
>That's what this line is supposed to do:
>
>
>string csScript = string.Format("EditAfterNew('{0}');", this.grdTrucks.ClientID);
>
>
>It embeds the client ID name of the grid into the Javascript. Right-click on the page after it should have been displayed and look for the injected JS. It shouldn't be empty. You can add the line:
>
>
>debugger;
>
>
>As the first line in your EditAfterNew() function VS should open the debugger for you so you can walk through this code.

Yea, I forgot about that. I added the debugger line in the method but it doesn't do anything.
This is what is in the source after the page runs.
<script type="text/javascript">
//<![CDATA[
EditAfterNew('ctl00_TrackerMasterContent_grdTrucks');//]]>
</script>
I put an alert in that method and it never happens.
Something must be blocking this stuff from working, but I sure don't know what it is.
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform