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

Post New Web Links

Inline <% %> code not allowed in updatepanel?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

When I try to use inline code in a div in my updatepanel the site builds and compiles ok and the initial load of the page is fine but when I try to operate the select in one of the contols (a gridview) in the update panel it fails with an "!Error on Page"...the content of the error on page is...

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.6; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Fri, 20 May 2011 18:18:02 UTC

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
Line: 868
Char: 13
Code: 0
URI: http://theipaddresswashere/ScriptResource.axd?d=xfimS0ngiKh89CutFNtzHucUqb8-yyUScfH1ZVLVz7tNO6L-A6kFCD_MqYSTYMOSEx9O3KUkiiUwEWo687qhNwgnpkOFDpNwub8It0_JB2qP2FkL9y85yRPoYt-kJcPKojGzaewzbfmL6e-DDoDho_EpuexGGAnGoLIBrqlnLPt97N5qbAFf3zwR6hTQq1PQ0&t=2610f696

 In this case I have a div in the updatepanel that trys to retrieve and present the cont

View Complete Post

More Related Resource Links

how to set break point at inline code

I set the element height value by using inline code 
<%# Eval("s") %>
where "s" is the variable declared in page load event. when i run the application it don't set the height. 
Is there any way, i can set break point into .aspx file. i mean how i can check if my Eval("s") get the value.  

Wicked Code: UpdatePanel Tips and Tricks


Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

Calling WCF Services From Silverlight Keeping The Code Inline in VB.NET

Hello,   I have a large amount of code that I'm trying to convert to a Silverlight 4 Application from a VB.NET Win Forms App.  All of the business logic code is written inline calling stored procedures on a database.  There is so much code that it's overhelming to be making asynchronous call after asynchronous call back to the WCF service.  The code is now all over the place since I'm having to chain methods all around after the WCF calls complete.    I don't really need these WCF calls to be done synchronously (since we don't want to block the main UI thread), but is there any good way in VB.NET to keep all the code in-line when calling a WCF service?  Is there some sort of wrapper that can be used to call the WCF methods or another way?  I know some of this is done easier in C#, but I'm having some issues with this being done in VB.NET.   Example In The VB.NET App I'm Converting:   Dim Customer As New Customer   If Customer.CheckIfCustomerExists(10) = True    'Calls the database, checks if Customer #10 exists        'Do Something   Else       Dim CustomerNum As Integer = Customer.InsertNewCustomer("Customer Name")       'Do Something    End If In Silverlight This Woul

Performance Point: Code blocks are not allowed in this file.

Hi All,I'm trying to use Performance Point 2010 in Sharepoint 2010...I have start the application in centrel adminI have created a site collection based on the Bisuness Intelligence Center templateI can surf the new Site Collection but when I try to open the "Start using PerformancePoint Services" link I get the following error:"An error occurred during the processing of /PerformancePoint/Pages/ppssample.aspx. Code blocks are not allowed in this file."is there any way to fix it???is there any good source to understand and deploy Performance Point 2010??thanks AllVit

Tryin to Code inline

Hi there...I am sitting with a problem where i have a checkbox inside of a dataGrid. Now when this checkbox is executed it needs to pass its Client ID to the Javascript Function. Now i know when using MasterPages like in this case your ID changes so you have to look at the ClientId. so what i'm trying to do is to use InlineCoding like this...<ItemTemplate >               <asp:CheckBox runat="server" AutoPostBack=false ID="chkReceived" OnClick="javascript:return response('<%= chkReceived.ClientID %>');">             </asp:CheckBox></ItemTemplate>Coding it like this also does not bring up the IntelleSese. That already tells me that there is a problem. So hopefully you can help me?but for some reason when i compile the code it comes out like this.<input id="_ctl0_ContentMain_grdDocApprovals__ctl2_chkReceived" type="checkbox" name="_ctl0:ContentMain:grdDocApprovals:_ctl2:chkReceived" onclick="javascript:return response('&lt;%= chkReceived.ClientID %>');" />Its not passing through the ClientId of the control but rather the Value of '&lt;%= chkReceived.ClientID %>at this stage all the Javascript function does is to

Changing Properties/Attributes of a Webpart in inline code block - Error 'System.Web.UI.WebControl

I'm trying this code below, but gettting error: System.Web.UI.WebControls.WebParts.WebPart' does not contain a definition for 'FilterValue1' I need to change the value of the FilterValue1 properties of a content Query WebPart with title = Applicant Files. Thanks in Advance!
protected override void OnLoad(EventArgs e) {  base.OnLoad(e); SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite SiteCollection = new SPSite("https://somesite/")) { SPWeb myWeb = SiteCollection.OpenWeb(); myWeb.AllowUnsafeUpdates = true; Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager mgr = null; mgr = myWeb.GetLimitedWebPartManager("default.aspx",System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); foreach (System.Web.UI.WebControls.WebParts.WebPart myWebPart in mgr.WebParts) { if (myWebPart.Title == "Applicant Files") { myWebPart.FilterValue1 = "/13"; mgr.SaveChanges(myWebPart); break; } } } }); }

More illusive code (an inline style I can't seem to find)

I just *thought* was done. The issue is with the tree view in a document center. So with the help of the IE Developer Tools, I've managed to narrowed it down to an inline style but it doesn't tell me where that inline style resides (unlike everything else listed).  The culprit is a font-size:1em. The code in the source is: <td><img src="/_layouts/images/tvblank.gif" alt="" /></td><td><a href="javascript:_spNavigateHierarchy(this,'TreeViewDataSource','30:ListNode:df253e52-42eb-498a-8fc9-7bfabf220bfb:bbd65828-90c9-4b75-b4a8-ac304d01744e:160e6be3-d556-4fb9-887e-c1204f716aab','\u002fit\u002fPMO\u002fIntranet\u002fDocuments',false,'ListNode')" title="Documents" id="ctl00_PlaceHolderLeftNavBar_WebTreeViewt0i" tabindex="-1"><img src="/_layouts/images/itdl.gif" alt="Documents" style="border-width:0;" /></a></td><td class="ms-navitem ctl00_PlaceHolderLeftNavBar_WebTreeView_2" style="white-space:nowrap;"><a class="ctl00_PlaceHolderLeftNavBar_WebTreeView_0 ms-navitem ctl00_PlaceHolderLeftNavBar_WebTreeView_1" href="javascript:_spNavigateHierarchy(this,'TreeViewDataSource','30:ListNode:df253e52-42eb-498a-8fc9-7bfabf220bfb:bbd65828-90c9-4b75-b4a8-ac304d01744e:160e6be3-d556-4fb9-887e-c1204f716aa

How to use a custom server control that is defined in inline code in the same page?




I have to use inline code for an aspx page and I need to use a custom server control that is defined in the same aspx page but the control does not get processed as a server control. it gets  returned as is as static html tag.


does anyone know how to do that?





Parser Error Message : Code blocks are not allowed in this file

I've used inline coding in my javascript functions to get the clientID of the controls in the runtime as

 <%= ctrl.ClientID %>

But i'm getting the parser error. Also i'm getting

"The event handler OnClick is not allowed in this page".

So i modified the web.config to add a page parser -

        <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />

But i'm still getting the same error. I've cross checked lot of times whether i'm modifying the correct web.config.

Any ideas?


How do hand code UpdatePanel and UpdateProgress


I'm creating a mobile adapter and need to enclose everything inside an update panel and I need to hand code adding the controls to the page. I also need to have an updateprogress control

I've got a vague idea on the update progress, since it doesn't have a contenttemplate - - but not the rest

anyone know how to do this?

Inline code in a workflow?


Hi. Is it possible to write inline code in my workflow? E.g. I'd like to drop a scripting shape in to the workflow and write some code in to that shape. The closest I could find to this was a shape that calls my C# method.

The ability to write inline code in a workflow is supported in BizTalk. I was hoping to find it in .Net 4 workflow. Have I missed something?


Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool

code behine file values to inline


I have an aspx file written using vb.net that contains code both in code behind and inline. I want to access variable, object/classes declared in code behind into inline .aspx file. e.g. following code is written in File Name: Test.aspx.vb Imports System.Data Dim cCode as String cCode = "ABC" Now I want to access cCode variable in test.aspx file How this is possible ??

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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