473,805 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pb with skinID in templated columns having DataBinder.Eval

WT
Hello,

I have a usercontrol loaded in a page with a theme.

This usercontrol contains columns template with hyperlinks, with skinID.

The columns are not displayed, seems thta there is some not traceable
exception triggered and the all binding is stopped.

But this same named skinid is working for hyperlinks outside templates.

Is it a knwn problem ?

Thanks for help.

CS

Here is a sample of my code:

<asp:datagrid id="myDataGrid " runat="server" width="100%"
AutoGenerateCol umns="False" EnableViewState ="False" AllowSorting="T rue">
<Columns>
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:HyperLin k Text="<%$ Resources:Resou rcesGen,EDIT %>"
SkinID="editHyp erLink" NavigateUrl='<% #
BuildUrl(Config .ModulesPath+"/Cont/ContEdit.aspx", PageNum,"ItemNu m=" +
DataBinder.Eval (Container.Data Item,"ItemNum") )%>' Visible='<%# IsEditable
%>' runat="server" />
</ItemTemplate>
</asp:TemplateCol umn>


May 18 '07
14 2023
WT
Thanks for answer.

I will ask for a small sample. It's difficult because we use a huge library
which contains all logic with custom controls, DB access, UI, etc...

We have also noticed that inserting a div around the hyperlink drives it to
run normally ??????
In fact problem seems to be in the usage of SkinID inside the hyperlink when
in a datalist item.

Without the div, hyperlink is not rendered totally we only get the <a with
the href='...' then nothing more: the </ais missing and the <imgnormally
rendered inside with a path to the image specified in the skinid is not
there.
When the div is there everything is rendered correctly ????

CS
Any idea ?

CS

"Walter Wang [MSFT]" <wa****@online. microsoft.coma écrit dans le message
de news: 0j************* *@TK2MSFTNGHUB0 2.phx.gbl...
Hi CS,

Thanks for the update. Do you have a reproducible project to show the
problem of the ImageButton? Thanks.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 19 '07 #11
Hi CS,

I think we can use some mock data to test the skin behavior.

Sorry I cannot tell exactly what might be wrong at current moment without
full code listing.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 20 '07 #12
WT
Hello Walter,

Adding the virtual Render method in our code, with a try-catch around
base.Render we get an exception with:

Cannot use a leading .. to exit above the top directory.
at System.Web.Util .UrlPath.Reduce VirtualPath(Str ing path)
at System.Web.Util .UrlPath.Reduce (String path)
at System.Web.Util .UrlPath.Combin e(String appPath, String basepath, String
relative)
at System.Web.UI.C ontrol.ResolveC lientUrl(String relativeUrl)
at System.Web.UI.W ebControls.Imag e.AddAttributes ToRender(HtmlTe xtWriter
writer)
at System.Web.UI.W ebControls.WebC ontrol.RenderBe ginTag(HtmlText Writer
writer)
at System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.W ebControls.Hype rLink.RenderCon tents(HtmlTextW riter writer)
at System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children)
at System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer)
at System.Web.UI.W ebControls.Tabl eCell.RenderCon tents(HtmlTextW riter writer)
at System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children)
at System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer)
at System.Web.UI.W ebControls.WebC ontrol.RenderCo ntents(HtmlText Writer
writer)
at System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.W ebControls.Tabl e.RenderContent s(HtmlTextWrite r writer)
at System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children)
at System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer)
at System.Web.UI.W ebControls.WebC ontrol.RenderCo ntents(HtmlText Writer
writer)
at System.Web.UI.W ebControls.Base DataList.Render (HtmlTextWriter writer)
at System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter)
at System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)
at System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children)
at System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer)
at System.Web.UI.C ontrol.Render(H tmlTextWriter writer)

This seems to be generated by the skinId, when the hyperlink try to add its
image in the anchor.
I still dont understand why, and why when adding a div around this, all
seems to work....I have checked, there are no reasons for 'a leading .. to
exit above the top directory' in our skinid and in the current server
executing path ?????,

And I don't understand why the exception is not sent to our Application
Error Handler in global.asax, under normal conditions all our exceptions
catching are traced and rethrow to reach global handler.
And I get no trace ???? the Page.render continue its work, missing some
parts of the rendering (no closing </a>).
Is it possible that .net catches something from the sending of Render
without any warning or trace?

CS

"Walter Wang [MSFT]" <wa****@online. microsoft.coma écrit dans le message
de news: ek************* *@TK2MSFTNGHUB0 2.phx.gbl...
Hi CS,

I think we can use some mock data to test the skin behavior.

Sorry I cannot tell exactly what might be wrong at current moment without
full code listing.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 20 '07 #13
WT
Walter, it looks like a MS bug.

In fact when we set a SkinID in an hyperlink used in a Datalist, it appeard
that the path for the imageurl, comming from the skin, is set with a path
like ~/App_Themes/MyTheme/MyImage.gif.

We get this using the ItemDataBound event and tracing the imageurl for the
Hyperlink.

Until now this is not a problem, but it appears that during Render, the
private methods
System.Web.UI.C ontrol.ResolveC lientUrl(String relativeUrl)
expecting a relative url, transforms this in
.../../App_Themes/MyTheme/MyImage.gif
- this could be normal as the usercontrol being rendered is in an url 2
levels under the web site path-

then System.Web.Util .UrlPath.Reduce VirtualPath(Str ing path) discovers that
we are trying to get beyond the site root url and throw an exception and the
code for hyperlink is not rendered.

So we transformed the imageurl set from the skin, removed the ~ and Render
runs normally.

Should we have to do this everytime, what could be the reason for this ?

ReduceVirtualPa th seeems to be failing in some special conditions ???

Thanks for help.

CS



"Walter Wang [MSFT]" <wa****@online. microsoft.coma écrit dans le message
de news: ek************* *@TK2MSFTNGHUB0 2.phx.gbl...
Hi CS,

I think we can use some mock data to test the skin behavior.

Sorry I cannot tell exactly what might be wrong at current moment without
full code listing.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 20 '07 #14
Hi CS,

Things are a little complicated, could you please put up a reproducible
project and send it to me? My email address is in my signature below. Thank
you very much for your effort.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 21 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1463
by: Jim | last post by:
My subject probably isn't very descriptive of what I want to do, so let me explain: I wna tto have a website that holds a number of products, grouped by category. On the administration page of the website, I want to allow the operator to move products between categories. The interface I have in mind would have two dropdowns at the top, one to select the FROM categroy, which would cause the page to re-post, and thus display all of the...
4
5408
by: | last post by:
I have a datagrid with a template column that has a hyperlink and a label. The hyperlink text is bound to Title from my dataset and the label text is bound to Author in the dataset. The grid displays with the template columns showing the Title and the Author from the first row in all rows. The other none template columns are fine. Obviously I am not understanding something here. What am I missing????? -- Barry Fitzgerald
2
4554
by: Nicole | last post by:
I am creating template columns programmatically. I have read the msdn article on this and I'm so close. Article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchcreatingwebservercontroltemplatesprogrammatically.asp I have narrowed down the problem comes in when the _DataBinding handler is called and the literal text is being assigned, but I can't figure out beyond that. The main problem is that...
2
2115
by: | last post by:
Hello All, I am having a lot of difficulty trying to bind a templated column, that is programmatically created for a datagrid, to a datasource column. I have a datasource containing 2 columns, ID and VALUE. I would like to create a templated column in the datagrid that is bound to the VALUE column of the datasource.
1
1129
by: André Almeida Maldonado | last post by:
Hy Guys.. I have a datagrid with template columns. The datagrid have a datatable datasource. But when I try to bind data, I receive this error: DataBinder.Eval: 'System.Web.UI.WebControls.DataGridItem' do not have a property named "Codigo". See my code:
10
1987
by: DBLWizard | last post by:
Howdy, I need to compine two columns (LastName, Firstname) with the comma. The only problem I have is the Firstname could be blank and in that case I don't want the "," appended to the last name. This data is coming out of a Sql Server data base. I am currently using a DataReader and simply binding it to a data grid to display the information.
2
1262
by: Shafia | last post by:
Hi, My GridView has templated controls in it and I'm binding to an ObjectDataSource. The problem is it refused to bind to my grid column "ColumnName" which is also an UpdateCommand Parameter for the ObjectDataSource. It displays the following error "DataBinding: 'System.String' does not contain a property with the name 'ColumnName'. I've also cheched it with FormView and that is not binding either. same error.
2
3554
by: mikepolitowski | last post by:
Hi folks, I am have been trying to solve this problem for quite some time now and would appreciate any advice. I have been trying to call a code-behind function that is defined in my aspx.cs from within a DataList <ItemTemplate> block using the <%# %> syntax. I would not have written here if I had not spent over 6 hours trying to find a solution to this problem again any advice is greatly appreciated. I have included a code snippet...
1
2123
by: Brett Wesoloski | last post by:
I am new to using template columns. I am just trying to create a data grid with a bound column and another column with a imagebutton in it. What I have always done in the past was to then create a datatable and bind that to the datagrid. Where is my code to bind the grid to the datatable. DataTable dt = new DataTable(); dt.Columns.Add("FundDescription");
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.