web-controls

DotNetNuke: GridView incompatible with Data Access Layer?

只愿长相守 提交于 2019-12-12 06:15:50
问题 I'm working on a DotNetNuke module in C#, and in order to cut down on the amount of complexity I have elected to try and keep the configuration of the module in one page (other than the standard Settings module). I now wonder how wise of an idea that is. My module is a simple image gallery, with one or many images. Each image has a title, an image source (url) and a destination (another url). Therefore, I figured that for my admin interface, I could have a simple 'grid' of data where you can

saving values of textbox in a loop (asp.net web page)

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:27:51
问题 I've been trying to follow a few tutorials and code examples but something isn't working as I'd expect. I have a series of textboxes on a webpage and I need to loop through each one and save it's value to the database. The number of textboxes on the page will vary. I load them from a database. They are all added to a table object. TableCell cellb = new TableCell(); TextBox txtAnswer = new TextBox(); txtAnswer.TextMode = TextBoxMode.MultiLine; txtAnswer.Rows = 2; txtAnswer.ID = "field_" +

web userControl

柔情痞子 提交于 2019-12-12 03:08:31
问题 I have create a new empty web application in c# Asp.net 4.0 and then added App_Code folder then added 3 classes into that folder. I have added a web user control and set the reference of App_Code class into the control but it throws an error. The type or namespace name 'App_Code' does not exist in the namespace (are you missing an assembly reference?) Any ideas? 回答1: This point can be confusing. A " web application project " is not expecting the App_Code folder. A " website project " would

Omit Properties from WebControl Serialization

我们两清 提交于 2019-12-11 19:46:02
问题 I have to serialize several objects inheriting from WebControl for database storage. These include several unecessary (to me) properties that I would prefer to omit from serialization. For example BackColor, BorderColor, etc. Here is an example of an XML serialization of one of my controls inheriting from WebControl. <Control xsi:type="SerializePanel"> <ID>grCont</ID> <Controls /> <BackColor /> <BorderColor /> <BorderWidth /> <CssClass>grActVid bwText</CssClass> <ForeColor /> <Height />

Wrong ClientID for dynamically added child control

冷暖自知 提交于 2019-12-11 19:36:49
问题 I am trying to rework asp.net usercontrol with .ascx markup to WebControl(only .cs). In my_new_webcontrol.cs I have: private readonly DropDownList _source = new DropDownList(); protected override void OnInit(EventArgs e) { base.OnInit(e); _source.ID = String.Format("{0}{1}{2}", ID, IdSeparator, "Source"); Controls.Add(_source); } protected override void Render(HtmlTextWriter writer) { RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { _source

jquery plugin loaded but 'inaccesible' in WebControl

南楼画角 提交于 2019-12-11 18:06:54
问题 I'm having trouble making a fixedTableHeader. I've found a jQuery plugin that works fine in simple test. But I need to include it as an embedded resource in a WebControl. So I'v registered the scripts in the Assembly.cs and set them to be 'embedded resources' In the WebControl they are registered like this: this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "jquery", Page.ClientScript.GetWebResourceUrl(this.GetType(), "LRGrid.jquery_min.js")); var fixedScript = Page

How to stop a web control from loading child controls?

a 夏天 提交于 2019-12-11 17:43:25
问题 This is for ASP.NET. Think about the multiview control. It has 1 to many view controls. Each view control has the ability of holding controls, but, yet, only one view is visible at a time. Keeping that in mind, I'm thinking I want to "tell" the non-visible views to NOT LOAD, therefore, NOT LOADING the child controls. In my sample, during the view's load, I check to see if it is the active view. If it is not active, then I stop processing the load. Unfortunately, views that are not active

ASP.NET WebControl & Page - Adding controls (like TextBox) dynamically

被刻印的时光 ゝ 提交于 2019-12-11 05:35:23
问题 I'm trying to create a custom server control (WebControl) with a text box. I add asp.net textbox to the custom control in CreateChildControls override. In OnInit override I add event handler to TextBox.TextChanged. Everything works, except that TextChanged never fires. I looked at viewstate and it looks like my textbox never saves its Text property in the viewstate. I've tried to set Text in various places, including constructor, but nothing works. How can I get TextBox dynamically added to

Get value from text box in User Control from Web Page

一个人想着一个人 提交于 2019-12-11 04:36:39
问题 I have this Web Control call uc_Register.asxc Inside this web control got a Text Box i.e txtName I add this Web Control into my web page call register.aspx <%@ Register Src="~/controls/uc_Register.ascx" TagPrefix="ecommmbs" TagName="uc_Register" %> <hr /> <ecommmbs:uc_SummaryCart runat="server" ID="uc_SummaryCart" /> <hr /> i want to get the value from txtName.txt from uc_Register.asxc at register.aspx. how to make this happen? 回答1: Try this in Register.aspx TextBox txtbox = (TextBox)uc

How To Find Checked Radio Button Using Group name My code Attached?

丶灬走出姿态 提交于 2019-12-10 19:35:56
问题 i am trying to find the value of checked radio using group name i have method that return it but what should i pass in that method along with group name method is here, private string getRadioValue(ControlCollection clts, string groupName) { string ret = ""; foreach (Control ctl in clts) { if (ctl.Controls.Count != 0) { if (ret == "") ret = getRadioValue(ctl.Controls, groupName); } if (ctl.ToString() == "System.Web.UI.WebControls.RadioButton") { RadioButton rb = (RadioButton)ctl; if (rb