servercontrols

calling a public function of an asp.net ajax server control from client side

旧城冷巷雨未停 提交于 2019-11-28 11:38:43
问题 I want to make a ajax server control in ASP.NET and in that application I have a textbox and I want to send text of that textbox to function that is created in ASP.NET ajax server control class and that function return some result based on text. My Application uses Server controls which are Imported from External DLL added as a reference. This Server Control will make use of AJAX to complete its functionality. To use My control, I would add the Script Manager and My Control on the .aspx page

Creating an asp:Button programmatically?

人走茶凉 提交于 2019-11-28 07:35:19
问题 I'm using my code-behind page to create a save button programmatically: Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnClick attribute in the following line, I can specify OnClientClick but this isn't the one I want to set. 回答1: Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; btnSave.Click += new System.EventHandler(btnSave

ASP.NET Server Control Property Attribute must be required

别来无恙 提交于 2019-11-28 04:43:16
问题 I have a custom ASP.NET server control CustomControl with a property attribute Path . If the Path is not explicitly specified, then I want an exception to be thrown. For example, <myControls:CustomControl Path="somedirectory/someotherdirectory/somefile.ext" runat="server" /> should compile, and <myControls:CustomControl runat="server" /> should throw an exception. I realize I can do this in the getter of the Path property, but is there some attribute that necessitates this? Update Is there

ASP.NET Control to HTML tag equivalent

落花浮王杯 提交于 2019-11-28 02:53:50
I'm looking for a cheat sheet that will allow me to show an HTML designer the equivalent asp.net controls for standard HTML tags. As an example the <asp:Panel> will render as an HTML <div> and an <asp:Label> will render as an HTML <span>. I've been googling this to no avail. Can someone post a link to a good cheat sheet so that the designers on this project can understand the markup on the aspx pages more clearly. To be clear, I would like a link to a list of major ASP.NET controls, with descriptions as to how they would relate to standard HTML. It would be great if this were in PDF format or

ASP.NET Control to HTML tag equivalent

假装没事ソ 提交于 2019-11-27 05:00:28
问题 I'm looking for a cheat sheet that will allow me to show an HTML designer the equivalent asp.net controls for standard HTML tags. As an example the <asp:Panel> will render as an HTML <div> and an <asp:Label> will render as an HTML <span>. I've been googling this to no avail. Can someone post a link to a good cheat sheet so that the designers on this project can understand the markup on the aspx pages more clearly. To be clear, I would like a link to a list of major ASP.NET controls, with

Change Text Box Color using Required Field Validator. No Extender Controls Please

佐手、 提交于 2019-11-26 08:10:49
问题 I need to change color of TextBox whenever its required field validator is fired on Clicking the Submit button 回答1: What you can do is register a Javascript function that will iterate through the global Page_Validators array after submission and you can set the background appropriately. The nice thing about this is that you can use it on all of your controls on the page. The function looks like this: function fnOnUpdateValidators() { for (var i = 0; i < Page_Validators.length; i++) { var val