Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Wednesday, March 28, 2012

Postback in FF

Hi All,

I have used ajaxcontrol toolkit in my application.
I have also implemented autosuggest list using classic XMLHTTP.
when I type search keyword in textbox it populates list , from list when I select record and hit enter key entire page is postback.

Please help me for same.

Hi Mukseshzala,

Based on your description, I think you should better use AutomComplelte control + WebService. Just like ths. You can get the whole source code from Ajax ControlToolkit Control.

Mukeshzala:

when I type search keyword in textbox it populates list , from list when I select record and hit enter key entire page is postback.

Please add this to your page , the onItemSelected function will be fired when click on the items.

<script type="text/javascript" language="javascript">
function pageLoad(){
$find("AutoCompleteEx").add_itemSelected(onItemSelected);
}
function onItemSelected(sender,eventArgs){
alert(sender.get_element().id);
}
</script>

I hope this help.

Best regards,

Jonathan

PostBack is happening even after using Update Panel and Script Manager

Hi,

I have a ASP.NET web application. I have a gridview and using a RowDataBound andRaisePostBackEventevent for getting the GridView details in the controls below like textboxes, dropdown etc. Now i am using Ajax Extensions controls like Update Panel and Script manager to avoid a postback happening when the GridView row is clicked. Even after implementing them postback is happening. Please see the code bits and let me know if i am missing somewhere.

UI

<asp

:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></asp:ScriptManager>

<

asp:UpdatePanelid="UpdatePanel1"runat="server"UpdateMode="Conditional">

<contenttemplate>

<asp:GridViewID="GridView1"runat="server"OnRowDataBound="GridView1_RowDataBound"CssClass="sampletable"AlternatingRowStyle-CssClass="d1"ShowHeader="true"ShowFooter="false"AllowPaging="true"AllowSorting="true"AutoGenerateColumns="false"DataKeyNames="ProjectID"Width="100%"PageSize="5"><Columns>

<asp:BoundFieldVisible="false"HeaderText="Project ID"DataField="ProjectID"SortExpression="ProjectID"/><asp:BoundFieldHeaderText="Project Name"DataField="ProjectName"SortExpression="ProjectName"/><asp:BoundFieldHeaderText="Site Name"DataField="SiteName"SortExpression="SiteName"/></Columns></asp:GridView><asp:LabelID="Label1"runat="server"Text="Label"></asp:Label><asp:TextBoxID="TextBox1"runat="server"></asp:TextBox><asp:ButtonID="Button1"runat="server"Text="Button"/>

</

contenttemplate>

<

Triggers>

<

asp:AsyncPostBackTriggerControlID="GridView1"EventName="RowDataBound"/>

</

Triggers>

</

asp:UpdatePanel>

And theCode behind for RowDatabound event is

protected

void GridView1_RowDataBound(object sender,GridViewRowEventArgs e)

{

try

{

if (!((e.Row.RowType ==DataControlRowType.Pager) || (e.Row.RowType ==DataControlRowType.Header) || (e.Row.RowType ==DataControlRowType.Footer)))

{

System.Web.UI.

ClientScriptManager cs = Page.ClientScript;//Assign Row Index. This row index used in finding the ID of the clicked rowint intRowIndex = e.Row.RowIndex;

e.Row.Attributes.Add(

"onClick", cs.GetPostBackEventReference(this, intRowIndex.ToString().Trim()));

e.Row.Attributes.Add(

"onKeyDown","if( event.keyCode == 13 ) " + cs.GetPostBackEventReference(this,"KEYDOWN" +"$" + e.Row.DataItemIndex.ToString().Trim()));

}

}

catch (System.Exception ex)

{

//OnError(ex);

}

}

The code looks good, did you try a easy test to see if the postback is hidden?

http://alpascual.com/blog/al/archive/2006/12/21/Code-Snip-_2200_AJAX-Timer_2200_.aspx

Try the sample below and let me know if you see the postback


Thanks for the Quick Response.

But i could not get exactly what you want to convey.

regards,

Parimal


Ok, wrap a asp:button around an updatepanel and let me know if you see the postback

Hi,

The button is working fine without any post back. The Post back is happening when Grid Row is clicked as it call the RaisePostBack event to get the Row details. That event is coded as we have not used any command template in Grid.

regards,

Parimal


OnRowDatabound would not make sense for an async trigger. The user clicking the row and getting a postback via the javascript you added to the onclick is not the same. If you take out the trigger and just add ChildrenAsTriggers="true" to the UpdatePanel it would probably work as you expect.

One other thing - in this code:

"onClick", cs.GetPostBackEventReference(this, intRowIndex.ToString().Trim()));

e.Row.Attributes.Add(

"onKeyDown","if( event.keyCode == 13 ) " + cs.GetPostBackEventReference(this,"KEYDOWN" +"$" + e.Row.DataItemIndex.ToString().Trim()));

Change "this" to GridView1. You want to create a postback for your gridview, not the whole page. Since you're creating a custom postback you'll also need to register for event validation, or disable event validation in your page.


Thanks for the response. But still post back is happening. I will explain in details

1. I have a Gridview RowDataBound event which fires when Data is bounded to Grid.

2. I have aRaisePostBackEvent which fires when the row in the Grid is selected and this causes the Post Back event.

3. Aslo my UserControl is implementingIPostBackEventHandler interface.

Thanks in Advance,

Parimal

Povide Drag Option across Datagrids(Drag and Drop)

Thanks in advance for assisting me,

I am developing a asp.net web application(VB.Net).

I am New to AJAX and have a requirement where i should be able to select(say using a check box) and drag(move) a particular or a set of rows from one datagrid to a another datagrid in the same page.

Is this feasible ,what should be the approach......

Hi,

If your using checkbox or any other way to mark the rows you wanted move..... you can either create a xml ....(The data to be moved) or you can create a temp table and you can update the new datagrid... well, I am not quite sure that, through client side code the data can be moved between two datagrid is possible..? May be primary datagrid data can be as XML document though which the secondary data grid can be updated......

Monday, March 26, 2012

Preview DragDropManager does not work at all

I'm writting an application that uses extensively drag and drop. It used Sys.UI.DragDropManager and worked fine on July CTP. Now I'm getting a lot of errors in the new Preview DragDopManager. I guess I should not using this one, instead I'm trying to use AjaxControlToolkit.DragDropManager, as it seems to work with the Ajax Control Toolkit.

Hi,

you're right, the DragDropManager defined in the CTP uses type methods (Array.add, Array.remove) that aren't defined anywhere. The DragDropManager contained in the AjaxControlToolkit is the one contained in the July CTP, though you might want to correct the following issue until a Toolkit refresh is available:

http://forums.asp.net/thread/1436147.aspx


Thank you Garbin. I'm using AjaxControlToolkit.DragDropManager with the suggested workaround and it seems to work properly. However there is another bug in the DragDropManager. In some circumstances (sorry I can tell you exactly what circumstances), DragDropManager calculates incorrectly the statingPoint. This bug was in July CTP and is in AjaxControlToolkit.DragDropManager. Sometimes, when you start dragging a control, the drag visual goes way from its natural position, it goes below and right. I'm using the following workaround IDragSource behavior:

// cuando se pulsa con el ratón en el asa para mover
// se comienza la operación Drag and Drop
function OnMoveHandleMouseDown(e)
{
//debug.trace('OnMoveHandleMouseDown');

_startingMove = true;

// salvamos la posición actual del ratón
// para poder calcular luego startingPoint.
_lastClientX = e.clientX;
_lastClientY = e.clientY;

// salvamos la posición del control
// y del scroll para poder calcular luego startingPoint
var x = parseInt(_frame.style.left.replace('px',''));
var y = parseInt(_frame.style.top.replace('px', ''));
var scroll = Sys.UI.Control.getScrollPosition( _frame );

saveOriginalPosition();
window._event = e;
AjaxControlToolkit.DragDropManager.startDragDrop(this, _frame, null);

//hay un bug en el DragDropManager que calcula incorrectamente
//startingPoint, con lo que el control se va lejos
//de la posición donde debería estar. Por eso hay que reponer
//la posición de control y calcular el startingPoint
resetPosition();
_frame.startingPoint = {
x: _lastClientX - x + scroll.x,
y: _lastClientY - y + scroll.y
};

if (window.__safari) {
document.onselectstart = _onSelectStartDelegate;
} else {
$addHandler(document, 'selectstart', _onSelectStartDelegate);
}
}

Basically I'm calculating the startingPoint, I'm assuming (i konow it) that _frame.style.position = 'absolute'.

Here is saveOriginalPosition:

function saveOriginalPosition()
{
var left = parseInt( _frame.style.left.replace('px', '') );
var top = parseInt( _frame.style.top.replace('px', ''));
_originalPosition = { x:left, y:top };
}

and Sys.UI.Control.getScrollPosition:

Sys.UI.Control.getScrollPosition = function(element) {
var scrollLeft = 0;
var scrollTop = 0;
var parent;

for (parent = element.parentNode; parent; parent = parent.parentNode)
{
if (parent.scrollLeft) {
scrollLeft += parent.scrollLeft;
}
if (parent.scrollTop) {
scrollTop += parent.scrollTop;
}
}
return { x: scrollLeft, y: scrollTop };
}


I mean I can't tell you ...

Hi,

thank you for posting the code, I'll try to understand what's happening there.

Let me know if you manage to write a repro for this issue.


Sorry, but time restrictions prevent me to create a simple repro. However I can tell you what I discovered.

1) the _drag method sets the location (setLocation(position)) based on this calculus:

position = mousePosition - statingPoint + scroll // please, assume these are 2D vectors and we have overloaded the operators.

2) when starting the dragging operation, if the original position of drag visual is 'absolute', the position must not be changed and:

staringPoint must be = mousePosition - position + scroll

3) However startDragDrop method calculates starting point as:

startingPoint = mousePosition - getLocation + scroll

getLocation can be different (likely greatter) than position (style.left , style.top) for an absolutely postioned element if it has a positioned ancestor other than body. This is because the drag visual moves down and right when starting the drag operation

4) startDragDrop contains an extrange logic. It does:

dragVisual.style.position = "absolute";

....

if (dragVisual.style.position == "absolute") {
dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, Sys.UI.DomElement.getLocation(dragVisual));
}
else {
var left = parseInt(dragVisual.style.left);
var top = parseInt(dragVisual.style.top);
if (isNaN(left)) left = "0";
if (isNaN(top)) top = "0";

dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, { x: left, y: top });
}

comparing position == 'absolute' has no sense if you previously set position = 'absolute'

I also think (not sure) it should be:

if (dragVisual.style.position != "absolute") {
dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, Sys.UI.DomElement.getLocation(dragVisual));
}
else {
var left = parseInt(dragVisual.style.left);
var top = parseInt(dragVisual.style.top);
if (isNaN(left)) left = "0";
if (isNaN(top)) top = "0";

dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, { x: left, y: top });
}

...

dragVisual.style.position = "absolute";


Ok, here is a repro:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID= "sm" runat="server">
</asp:ScriptManager>
<h1>Bug demostration</h1>
<p /><p /><p /><p /><p />
<div style='position:relative'>
<asp:Panel runat="server" ID="panel1" style='position:absolute;left:50px;top:50px;width:50px;height:100px;background-color:Blue;'>
<asp:Panel runat="server" ID="handle" style='position:absolute;left:0px;top:0px;width:50px;height:20px;background-color:Green;'>
</asp:Panel>
</asp:Panel>
<ajaxToolkit:DragPanelExtender ID="DragPanelExtender1" runat="server"
TargetControlID="panel1" DragHandleID="handle" />
</div>
</form>
</body>
</html>

Please, try to drag the panel, you will see how the drag visual moves down and right when you start the drag operation.

I applied the above changes and it seems to work :-)


Hi,

thanks. Is the above repro using the modified version of the Toolkit (i.e. the one with the fix suggested in the first reply) ?


Yes,
Whithout any changes, the repro shows the bug, with your first fix, the repro still shows the bug. With the fix I suggested does not show the bug.

Hi,

where is the file stored that has to be changed?


Jesús:

Whithout any changes, the repro shows the bug, with your first fix, the repro still shows the bug. With the fix I suggested does not show the bug.

Months later this bug still exists in the March '07 release. Any idea from MSFT if this fix will be incorporated into a release?

Gerry


Jesús:

Whithout any changes, the repro shows the bug, with your first fix, the repro still shows the bug. With the fix I suggested does not show the bug.

Months later this bug still exists in the March '07 release. Any idea from MSFT if this fix will be incorporated into a release?

Gerry


Jesús:

Whithout any changes, the repro shows the bug, with your first fix, the repro still shows the bug. With the fix I suggested does not show the bug.

Months later this bug still exists in the March '07 release. Any idea from MSFT if this fix will be incorporated into a release?

Gerry


Where do you incorporate this fix? You can show this in the case of your example.

Thanks

Vid

print button of Crystal report 11.5 didnt show pop-up dialog with AJAX

I have developed one web application with ASP.Net 2.0 with AJAX 1.0 and Crystal Report 11.5 Release 2.

When i put Crystal Report viewer in AJAX's update panel, Crystal report viewer is opened properly, but when i try to export or print the report from Crystal Report viewer, it is not showing any dialog box for export or print. Print mode of Crystal report viewer is ActiveX.

Can any body help regarding this problem with example(if possible) ?

Regards,

Krunal Shah

http://forums.asp.net/thread/1325110.aspx
(UpdatePanel does not allow the CrystalReportViewer control to print or export.)

http://forums.asp.net/thread/1660467.aspx
(button inside update panel Firefox problem)

etc., etc.

Problem about area of focus

Hello frnds,

I have created Web application using AJAX control tool kit......you may view it here......

www.calstate.edu/majors


My problem here is that If I select 1 item from DropDownList(DDL) 1 and then choose DDL2 and then press search button; everything works fine.....

But now If I select other item from DDL1 again, so I want the DDL2 to be set to default value as Before ie. I want it to be to Select Major Type/Degree....so what shud be added in order to change the default value of DDL2 back to original.


Thanks ur help is highly appreciated

Hemil.

write a event for DDL1's selectedindexchanged and set the ddl2's selectedindex to 0.

And also mark enableautopostback to true for ddl1


hi,

After seen the site I think the problem is that the selected value of second DDL is remain as it is so after the search result of in the selected index chnage event of first DDL just make the SelectedValue to default means index to 0 every time then it will be work


I tried changing the same, but When I write the line in the function

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)

it says cannot assign to majorDDL_SelectedIndexChanged becoz it is a method grp.......so where shud I write the value 0....


Could you please share your code?


C-sharp file

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)
{
visibleOff();
searchButton.Enabled = false;

}

.aspx file

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" /
<label for="majorDDL" style="display:none;">Select Programs Name and Type:</label><asp:DropDownList ID="majorDDL" runat="server"
OnSelectedIndexChanged="majorDDL_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server"
ServiceMethod="GetDropDownContents"
UseContextKey="True"
Category="major"
LoadingText="..."
PromptText="Degree Major/ Program Name"
ServicePath="MajorsDatabase.asmx"
TargetControlID="majorDDL">
</ajaxToolkit:CascadingDropDown>
<br /><br />
<label for="typeDDL" style="display:none;">Select Programs Name and Type:</label>
<asp:DropDownList ID="typeDDL" runat="server"
OnSelectedIndexChanged="typeDDL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>

<ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server"
ParentControlID="majorDDL"
Category="type"
ContextKey="..."
PromptText="Degree Major/ Program Type"
ServiceMethod="GetDropDownContents"
ServicePath="MajorsDatabase.asmx"
TargetControlID="typeDDL">
</ajaxToolkit:CascadingDropDown


I want to make DROPDOWN 2 value to default ie it shud display the value of PromptText="Degree Major/ Program Type".......


I suppose this is automatically handle by extender

http://asp.net/ajax/ajaxcontroltoolkit/samples/

Saturday, March 24, 2012

Problem converting from Atlas beta to Ajax

Hi,

I have an application that uses the Modal Popup Extender control. I developed it using the beta of Atlas, and now I'm trying to convert it to version 1.0 of Ajax.

I've removed the Atlas references and added the one for the AjaxControlToolkit. I replaced the Atlas ScriptManager tag with the new ASP:ScriptManger tag, and I replaced the Atlas ModalPopupExtender and ModalPopupProperties tags with the Ajax ModalPopupExtender tag. When I try to run the program, I get a Javascript error which says 'Sys' is undefined, and refers to the following code added at runtime:

Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ModalPopupBehavior, {"CancelControlID":"rpPermitsPlus_ctl00_OkButton","DynamicServicePath":"/PP_ServiceWorkTicket.aspx","PopupControlID":"rpPermitsPlus_ctl00_pnlTennantStatus","id":"rpPermitsPlus_ctl00_mpeTennantStatus"}, null, null, $get("rpPermitsPlus_ctl00_btnReport"));

Can someone tell me what I've done wrong, and what I need to do to get this application working again? Thanks for your help!

You need to edit your web.config in multiple places as well. I would suggest you compare the sample web.config in the ASP AJAX with your own.
That did it. Thanks kp0!

Problem in calling a Webservice in ATLAS Application.

Hi Every body im new to this community,

Im facing problem in calling the webservice from ATLAS Application .

If the WEbservice is in the same solution im able to do it, but when i create a new webservice and try to call in my ATLAS application im not able to do it,

Im getting following Error "

<atlas:ScriptManagerID="NamSpacescriptManager"EnableScriptComponents="false"runat="server">

<Services>

<atlas:ServiceReferencePath="SimpleService.asmx"/>

<atlas:ServiceReference

Path=http://localhost:3505/SimpleCalculator/SimpleCalculator.asmx/>

</Services>

</atlas:ScriptManager>

<scripttype="text/javascript"language="javascript">

function OnAddServiceClick( )

{

var response = SimpleCalculator.Add(3,3,Oncomplete,OnTimeOut,OnError);

returnfalse;

}

</script>

Im getting Error : SimpleCalculator , undefined, can i know what is wrong ...

Regards,

Hi,

The problem is that, a service reference to a web service causes an xmlscript reference in the generated page through a "/js" call to the web service.

If you examineCalling a simple Web Service from an ASPX page quick start sample, when you add
<atlas:ServiceReference Path="SimpleService.asmx" />
to your source, what is rendered as xmlscript is:
<references>
<add src="http://pics.10026.com/?src=SimpleService.asmx/js" />
</references>

Call SimpleService.asmx/js and you will get this piece of javascript:
Type.registerNamespace('Quickstart.Samples'); Quickstart.Samples.SimpleService = new function() { this.path = "http://atlas.asp.net/quickstart/atlas/samples/services/SimpleService.asmx"; var cm=Web.Net.ServiceMethodRequest.createProxyMethod; cm(this,"EchoString","s"); }

So, behind the scenes, Atlas client framework makes a call to the web service, asks the service to describe itself in javascipt and registers a function for you to call later from your code.

But there's no such default "/js" handler in web service world. Instead, Atlas provides necessary handlers in web.config to reply requests for "webservicename.asmx/js". That's why it works when your web service is in the same project with your Atlas GUI project.

If you enable the Atlas handler for .asmx files in your web service project as in your GUI project, it should work fine.

Problem In CollapsablePanel Extender

Hi Frnds,

I m new to Ajax, and i m using some toolkit extenders for my application.

When i declared a Label and an Image in the Header Panel of a CollapsablePanelExtender, its displaying controls on separate lines.

but i want to display label on the left side and image on right side.

Is there any tech to do like this since its taking more space and looking bad.

thanks in advance

Regards

Hasan

Hi Hasan,

I think you problem is a CSS related issue. Actually, itemplate header works as a div container but it is not recommended to changes its CSS directly. We suggest that you add another container (div) and add css style to the newly added container. For example,

<div style="width: 100%;">
<asp:Label ID="Label1" runat="server" Text="Label" Style="float: left"></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Style="float: right" /></div>

Another way is using a Table to control its showing position.

Best regards,

Jonathan

Wednesday, March 21, 2012

Problem in Deploying ASP.NET AJAX 1.0

I had deployed my application on server but getting error in :

"<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>"

Getting error in this line in web.config ...Please help me to solve this.

This is an exact error...

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35'.

Source Error:

Line 27: </controls>Line 28: <tagMapping>Line 29: <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>Line 30: <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="System.Web.UI.Compatibility.CustomValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>Line 31: <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="System.Web.UI.Compatibility.RangeValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



Looks like an old web.config. See http://smarx.com/posts/what-happened-to-the-validators-in-asp-net-ajax-1-0-rtm.aspx.

I have add Validators.dll and made the chages .

Still the problem is ...

Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Could not load type 'System.Web.UI.Compatibility.RequiredFieldValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error:

Line 1: <%@. page language="C#" autoeventwireup="true" inherits="Login_Default, App_Web_6jo3nll1" %>Line 2: Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Are you sure you updated your web.config as instructed on Matt's blog? You should be hitting System.Web.UI.WebControls.RequiredFieldValidator, not System.Web.UI.Compatibility.RequiredFieldValidator as shown in the error above.

Problem in export data from DataSet to Excel

I am using Ajax in my application......

my code will execute properly in normalwebform....

My Code:

publicvoid ExportTOExcel(DataSet ds,HttpResponse res)

{

this.Response.Clear();

this.Response.Charset ="";

this.Response.ContentType ="application/vnd.ms-excel";

System.IO.StringWriter sw =new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter hs =newHtmlTextWriter(sw); DataGrid dg =newDataGrid();

dg.DataSource = ds.Tables[0];

dg.DataBind();

dg.RenderControl(hs);

this.Response.Write(sw.ToString());

this.Response.End();

}

when i execute the same code inajax webform it show me following error.....

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '<table cellspacing="".

reply me ASAP........

Hi

I think the error message explain the issue clear.

You cann't modifiy response by calls to Response.Write(), response filters, HttpModules when you use AJAX. The message received from the server could not be parsed.


Then how to solve this problem do you any alternate solution for this error.........

send me any sample code...........

Please reply ASAP.


I'm experiencing the same issue. Found this article it will help you to understand some of the issues involved...http://mattberseth.com/blog/2007/07/indepth_the_updatepanel_aspnet.html

Mind you I haven't resolved the problem as yet, but it did take me one step closer.... so if any one find a solution please post.

problem in Update panel

Hi

I am using masterpage in my application.I put two contentplaceholder..left side and right side...In left side content I am putting menu...whenever i click on left menu, page should be open in right side contentplaceholder.Whole page should not be refresh....just right side contentplace holder should be change according to left menu click..it is possible using update panel ?..i put updatepanel on right side but it is not working..

Can anybody help..Please....

Please help me...

Thanks a lot...

Hi Sejal,

Check this article on using update panel in master pages -

http://ajax.asp.net/docs/tutorials/UsingUpdatePanelMasterPages.aspx

You can also try using update panel triggers(not sure how it will work in master page) -

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#SpecifyingUpdatePaneltriggers