Over the past several years I have been using the naming convention of FirstNameTxt when I'm referring to a TextBox Control for a 'First Name' field. However, I've noticed the majority of other developers tend to use the naming convention txtFirstName
Which is the best convention to use?
...
I created a user control in Asp.Net which I populate with <asp:Table id = "...." />
this table has columns that contain dropdownlists, textfields and other web controls...
In the code behind I am not able to access these web controls, is there a way I can access them.......or I shouldn't be doing that in the code behind of the user cont...
I'm subclassing (among others) System.Web.UI.WebControls.RadioButton. I want to allow child tags for configuration, like so:
<my:RadioPlus runat="server">
<option attr1="something" attr2="somethingelse"/>
<option attr1="something2" attr2="somethingelse2"/>
</my:RadioPlus>
The RadioPlus class is decorated with [ParseChildren(t...
Hi all,
Could anyone please enlighten me about how one might go about binding to a gridview in ASP.Net 4 in a scenario where the first row of my gridview should be the headers, the second should be a combobox for each column and the third is the beginning of my actual datasource.
If you can imagine what I am trying to achieve is an abi...
What is the best method to register a stylesheet once on a page from a customer web control? Please keep in mind that the page uses an UpdatePanel for async calls. I tried just putting the <link> tag in ScriptManager.RegisterClientScriptBlock(), but I get this error:
The script tag registered for type
'MyControl'
and key 'MyKey' ...
Hello!
I have a question about creating and managing events inside an ascx custom web control.
I have created a very stupid control consisting in a div containing a asp:Label control, it is a very simple structure:
<div id="mydiv" runat="server">
<asp:Label id="mylabel" text="Text"... />
</div>
That is, very simple.
I would like...
Is there any way allow I can modify value of SharePoing.WebControls before it is rendered.?
...
Hi!
I want to use WebBrowser control to load some localfile html page. I am aware that WebBrowser is just a wrapper around the InternetExplorer. As I remember Microsoft allowed users in Vista (?) to "uninstall" the InternetExplorer...
The question is:
Does WebBrowser runs smoothly with InternetExplorer uninstalled ? Does this uninstall ...
Hi,
Is it possible to set the property of a server tag from a c# expression, i.e. something like
<asp:TextBox Width='<%= [some c# expression] %>'/>
?
I though this would be pretty straightforward, but I can't get such an expression to run.
Thanks for any help
Ryan
...
Because the official dnn chat module is very outdated
...
Usage :
<uc1:WindowControl ID="Window_ExpoNews" runat="server" Height="265px" Title="Expo News"
Width="100%">
<ContentTemplate>
This content will show in the center cell of this user control.
<br />
I can even add real controls.
<asp:TextBox ID="TextBox1" runat="server" />
...
C# Visual Studio 2010
I have a complex webpage that contains several iframes that I am loading into a web browser control. I'm trying to figure out a way to refresh one of the iframes when a user clicks a button on the windows form.
I can't find anything specific to refreshing a single iframe. Any ideas?
...
Hello,
It's there a way i can control the ID of my HtmlGenericControl.
I try to create my own HtmlGenericControl and override UniqueID, ClientID, onPreRender etc ... but nothing work
...
I have a designer working at the ASPX level. He doesn't do C#, doesn't do code-behinds, doesn't compile, etc. He's a pure designer, working with HTML and server controls.
I need a conditional control -- an If...Then-ish type thing. Normally, I would do this:
<asp:Placeholder Visible='<%# DateTime.Now.Day == 1 %>' runat="server">
I...
TL;DR: All controls within a usercontrol that's being used outside it's home project are null when that usercontrol's Page_Init/Page_Load methods are called.
The setup is like this:
Projects "UI.Frontend", "UI.ControlPanel", and "UI.Common" are "ASP.NET Web Application"s. UI.Common is never meant to be accessed directly- it just conta...
The reason I want to know this is because it seems that __doPostBack('controlId','eventarg')
raises the unique event of the control specified, but I wonder what would happen if the control had multiple unique events.
...
Example code:
var div = new HtmlGenericControl("div");
div.Controls.Add(new Literal() { ID = "litSomeLit" });
var lit = (Literal)div.FindControl("litSomeLit");
Assert.IsNotNull(lit);
This code fails the assert, because lit is null. Debugging shows that div.Controls definitely contains a literal with ID of "litSomeLit....
Normally, unknown attributes of a webcontrol are passed through to to the rendered element in the browser. So the following works.
<asp:label runat="server" Text="Label Text" helpId="101" />
However, if you use a namespaced attribute like the following
<asp:label runat="server" Text="Label Text" myNs:helpId="101" /></div>
The att...
Is there a way to use linq to get a list of textboxes in a web page regardless of their position in the tree hierarchy or containers. So instead of looping through the ControlCollection of each container to find the textboxes, do the same thing in linq, maybe in a single linq statement?
...
I have a problem with the default value attribute.
When I add my control to page at design mode, default value does not work. This is my code:
[DefaultProperty("Text")]
[ToolboxData("<{0}:KHTLabel runat=server key=dfd></{0}:KHTLabel>")]
public class KHTLabel : Label ,IKHTBaseControl
{
[Bindable(true)]
[Category("Appearance")]
...