Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Dave #1
Setting user control property dynamically?
Hi I created a user control that has a property that accepts a url ("NavUrl")..
I tried to set the value as follows directly in the aspx page where strLink would be a link.
<uc1:mycontrol id="mycontrol2" runat="server" HtmlContent="html stuff goes here." ImgUrl="myimage.gif" NavUrl="<%Response.Write(strLink);%>"></uc1:mycontrol
Literal content ('">') is not allowed within a 'ASP.mycontrol_ascx'
The only way I was able to set this property dynamically was on referencing the control in my codebehing and set the property in the page_load()...is this the only way?
Dave Guest
-
Web user control creation - Resolve an ImageUrl property if control themed
Hi I'm creating a WebControl which has a themeable ImageUrl property : <Bindable(True), Category("Appearance"),... -
Dynamically Adding User Control with Child User Control
I have a user control that has a child user control. If I drag this onto the page, it appears and functions normally. If I attempt to add the... -
Setting a control property
I have a custom composite control which reads in information from an XML file in its createchildcontrols() event. I would like to be able to set... -
Error Setting user control property at web form
Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I... -
Refer to a custom property of a dynamically loaded user control
I have an app where I dynamically load a user control based on the type of data it is rendering. There are some standard custom properties that I... -
Natty Gur #2
Re: Setting user control property dynamically?
HI,
That should work :
Page code :
protected string s()
{
return "\"natty\"";
}
ASPX :
<form id="Form1" method="post" runat="server">
<uc1:a id="A1" URL=<%Response.Write(s());%> runat="server"></uc1:a>
</form>
generate HTML :
<uc1:a id="A1" URL="natty" runat="server"></uc1:a>
Natty Gur[MVP]
blog : [url]http://weblogs.asp.net/ngur[/url]
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest



Reply With Quote

