Groups > Asp .Net > ASP.NET Atlas Framework discussion > Re: Bug report: ATLAS, Updatepanel and <%Response.Write();%> within "" and Visual Studio Web Designer




Bug report: ATLAS, Updatepanel and
<%Response.Write();%> within "" and Visual
Studio Web Designer

Bug report: ATLAS, Updatepanel and <%Response.Write();%> within "" and Visual Studio Web Designer
Sun, 24 Sep 2006 12:40:00 +000
Hi,

This is as far as figured out an error of Visual Studio's Web Designer which
does not render pages for design under the below described circumstances. This
bug becomes important in the User-interface with graphical styles set within the
page within an ATLAS Update-Panel.

Problem description: 

I faced the problem when trying to set the Background-Image of a Table-Column,
which was within an ATLAS Update-Panel for partial page rendering. I want the
Background image to be loaded relative to the applications' path, so I used
<%Response.Write(ResolveUrl("~/Images/back.jpg"));%>

The table was within an ATLAS Updatepanel and the ResolveUrl statement in the
style='backgr...=url(<%...'. of a table <td>

When switching to design mode the page cannot be rendered at all and instead
fuzzy code is written.

I figured out that when removing the Semicolon ; at the end of <%Response... 
;  %> all will be rendered correctly.

Also when I remove the Updatepanel tags.

Compiled nevertheless all works fine, the bug should be only in Design time. I
decided to remove the UpdatePanel while designing and to put them back before
product deliver... Hope you can correct that issue.. 

And thanx to ASP.NET Team for their great work :)

Regards,

Sina Falahati 

 

 

Below the page's simplified - code, put it in VStudio and check yourself:

 

<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="
ProjectExplorer.aspx.cs"Inherits="UI_ProjectExplorer_ProjectExplorer&q
uot;Title="Untitled Page"%>

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

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<atlas:ScriptManagerID="ScriptManager1"runat="server"Enab
lePartialRendering="True">

</atlas:ScriptManager>

<atlas:UpdatePanelID="UpdatePanel1"runat="server"><
ContentTemplate>

<tableborder="0"cellpadding="0"cellspacing="0"s
tyle="width: 100%">

<tr>

<tdstyle="background-image:
url(<%Response.Write(this.ResolveUrl("~/Images/module_toolbar/RightSpace
r.jpg"));%>);">

Test

</td>

</tr>

</table>

</ContentTemplate>

</atlas:UpdatePanel>

</div>

</form>

</body>

</html>
Post Reply
Re: Bug report: ATLAS, Updatepanel and <%Response.Write();%> within "" and Visual Studio Web Designer
Sun, 24 Sep 2006 16:36:12 +000
You really shouldn't be using Response.Write() anywhere in an ASP .NET
application, apart from debugging. If you want to set styles programatically
then add a runat="server" to the control and give it an ID and use
that to reference it's properties.
Post Reply
Re: Bug report: ATLAS, Updatepanel and &lt;%Response.Write();%&gt; within &quot;&quot; and Visual Studio Web Designer
Sun, 24 Sep 2006 19:15:52 +000
Thank you. That works. 

Still, the bug as I believe is with Eval in general when used within
"" in above circumstances. It may be worth checking.

Regards, Sina
Post Reply
about | contact