Questions tagged [web-controls]

Web controls are classes that allow you to create Web server controls on a Web page

Web controls are classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes. They also include special-purpose controls such as a calendar. Because Web server controls run on the server, you can programmatically control these elements. Although Web server controls are rendered as HTML, their object model does not necessarily reflect HTML syntax.

586 questions
7
votes
5 answers

How do I make my ASP.NET server control take an embedded code block as a property value?

I have a custom server control with a property of Title. When using the control, I'd like to set the value of the title in the aspx page like so: more…
Jeff Martin
  • 10,812
  • 7
  • 48
  • 74
7
votes
6 answers

Can you recommend alternative FileUpload control for asp.net-mvc?

Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I wanted to know if anyone had experience with that or could suggest a better one? Some criteria to be measured…
dove
  • 20,469
  • 14
  • 82
  • 108
7
votes
3 answers

Is there an MVC way of doing ASCX?

Are ASCXs still used in ASP.NET MVC or should we be using something else?
BenAlabaster
  • 39,070
  • 21
  • 110
  • 151
7
votes
3 answers

Where in Visual Studio 2012 did Page Controls and Events goto for codebehind?

I can't for the life of me figure out how to do something that I did forever in VS2008 and earlier with VS 2012. When creating a web application, throw some server side controls on the page, then goto the codebehind and at the top of the code editor…
6
votes
7 answers

txtFirstName vs FirstNameTxt

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…
Curtis
  • 101,612
  • 66
  • 270
  • 352
6
votes
9 answers

Intermittent "Failed to load viewstate" error

Yes I know this problem has been reported many times, but my case doesn't seem to fit any proposed solutions (unless I miss something). The ASP.NET page setup (simplified) is: user clicks a link (technically a node of Infragistics WebDataTree) and…
Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136
6
votes
3 answers

Graphics in ASP.Net (c#)

I need help with my latest asp.net project. It involves graphics. I need to draw a circle and have several lines going from the middle to the edge (radius). This is the part I know how to do. The next part is the part I don’t know how to do and…
Bob Avallone
  • 379
  • 1
  • 10
  • 29
6
votes
1 answer

Only Content Controls are Allowed (C# webcontrols)

So, I'm not sure what's going on. My boss wasn't pleased with me using MVC and Razor, so I'm being forced to code with this nasty webcontrol/codebehind style. =/ The error is: Only Content controls are allowed directly in a content page that…
user798080
5
votes
3 answers

default value in asp.net server control

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>")] public class…
MHF
  • 157
  • 1
  • 3
  • 9
5
votes
3 answers

How to insert the ClientID of a div into an OnClientClick event

In the XHTML for a page I have:- This breaks. I need the correct syntax or method to insert…
Craig
  • 1,704
  • 1
  • 18
  • 36
5
votes
3 answers

Best practice when overriding Render methods on Asp.net WebControls, UserControls, Controls

When creating a custom WebControl, UserControl, Control and there is the need to override the various Render methods there are mainly 2 way to accomplish this: the quick and dirty: public override void RenderControl(HtmlTextWriter writer) { …
giammin
  • 18,620
  • 8
  • 71
  • 89
5
votes
1 answer

FileUpload control won't accept 0kb file?

I was using blank text files to run some tests, and was going crazy because FileUpload1.HasFile was always coming back false, even though it clearly had a file. I then switched test files to something above 0 kb (i.e. txt files with text in them),…
CptSupermrkt
  • 6,844
  • 12
  • 56
  • 87
4
votes
1 answer

Required Property in Custom ASP .NET Control

I am making a custom web control for my ASP page that inherits from CompositeDataBoundControl. I have a public property in the definition of my control that is required, if the user does not provide this property in the control definition on an ASP…
user1018669
  • 91
  • 2
  • 3
4
votes
1 answer

ASP.NET Web Control shows old data after the first postback

I'm having a weird problem with a custom Web Control in an ASP.NET forms application. For a web application, I figured that it would save me a lot of time to create a class which inherits from CompositeControl which combines a label with some other…
user849924
  • 318
  • 3
  • 9
4
votes
3 answers

ASP.NET Datepicker without calendar visualization

I'm working in C# / ASP.NET 3.5 and want to enable users to enter their date-of-birth. I've tried the asp:Calendar web control for this, and also considered using the jQuery-UI datepicker, and reviewed suggestions from this question. All those…
Jeroen
  • 60,696
  • 40
  • 206
  • 339
1
2
3
39 40