user control data entry form, use same codebehind as web form?

Hi All,

I have a quesiton about the approach I'm taking. I have a series of report forms which I have been in the process of consolidating to a single, generic page and subs/functions in a single code-behind.
All the reports can use the same set of data entry elements (a dropdown, a radio list, and a textbox). I'm trying to convert these elements to a user control. However, this user control seems to need to inherit differently than the rest of the code-behind. I've been using a single class in the code behind.
Is it feasible to separate out the data entry?
the code behind imports and inherits:

IMPORTS System
IMPORTS System.Data
IMPORTS System.Data.SqlClient
IMPORTS MicroSoft.VisualBasic
IMPORTS System.Web.UI
IMPORTS System.Web.UI.WebControls
IMPORTS System.Web.UI.HTMLControls
IMPORTS System.Web.HttpRequest
IMPORTS System.Web.HttpClientCertificate
IMPORTS System.Collections.Specialized
PUBLIC CLASS telcoCodeBehind
INHERITS System.Web.UI.Page

the user control with the data entry elements:

<%@ Control Language="VB" Debug="true" src="telco.vb" Inherits="telcoCodeBehind" %>
<asp:DropDownList id="ddl_ReportType" runat="server"
onSelectedIndexChanged="sub_Set_Report_Type"
AutoPostBack="True"
Width="225px" Height="10px"
Font-Names="Arial" Font-Size="8pt">
</asp:DropDownList>
<asp:RadioButtonList id=rdo_SetSelectType runat="server"
Font-Names="Arial" Font-Size="8pt"
OnSelectedIndexChanged="sub_Get_Filter"
RepeatColumns="3"
RepeatLayout="Flow"
AutoPostBack="True" >
<asp:ListItem value="ALL" selected="True">
Get All Records&nbsp;&nbsp;</asp:ListItem>
<asp:ListItem value="EXACT">
Find Exact Match</asp:ListItem>
<asp:ListItem value="LIKE">
Find Similar</asp:ListItem>
</asp:RadioButtonList>
<asp:Label class="lbl_Steps" text="&nbsp;" runat="server" /><br />
<asp:Label id="lbl_Step2" class="lbl_Steps" text="" runat="server" />
<asp:TextBox ID="txt_Input"
columns="10"
Font-Family="Arial"
Font-Size="8pt"
Runat="server" />

the compile error:
Parser Error Message: 'telcoCodeBehind' is not a valid base class because it does not extend class 'System.Web.UI.UserControl'.
Source Error:

Line 3:
Line 4: -->
Line 5: <%@ Control Language="VB" Debug="true" src="telco.vb" Inherits="telcoCodeBehind" %>
Line 6:
Line 7:

0
TheRealMVP
2/14/2005 6:14:50 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

0 Replies
1056 Views

Similar Articles

[PageSpeed] 21

Reply:

Similar Artilces:

can someone one give me difference between web form and mobile web form and which or where or when i'm using the forms?
thanks Marc Hi Marc, Based on my understanding, you want to know the differences between the ASP.NET web application and ASP.NET mobile web application. If I have misunderstood you, please feel free to let me know. The ASP.NET forms are used to develop the ASP.NET pages for desktop browsers and The ASP.NET mobile forms are used to develop the ASP.NET pages for mobile device browsers. When we create the ASP.NET mobile web forms pages, we can use nearly all the features of ASP.NET. But there are a couple of compatibility issues: Error Handling and Reporting. Tracing. Using Redi...

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspxSSNPlease remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

Solution for web forms that look just like paper forms ? User controls ? Adobe fillable forms ?
 I am looking at ways to web-enable a series of company forms that need to have the form itself look just like the paper version.  It would be great if I could use an image of the form itself as a background, and then draw the UI components on top of this.  Then there is the question of printing these forms complete with the data that was filled in.   What are some options for doing this kind of application ?  Im open to 3rd party solutions as well.  Our company currently has a desktop application which does this, but I want to come up with a web based solu...

Pass data from Web User Control to Web Form
I have a Web Form that contains a Web User Control. The WUC displays dynamic content. I want to change the TITLE property of the Web Form, based on the contents of the WUC. For example, if the WUC displays information about Horses, I want to change the page title to "HORSES" by passing the string to the parent Web Form. I have tried playing with parameters and such, but I can't remember how I did this in the past. PLEASE HELP!~o0 Spin-Monkey Oo~ The best way to do this is by creating a public property on your web user control and accessing that from your web form. Check ...

Using Win Form controls in web forms
Hi All,   Please tell me if i can't use the window forms controls in my webform. What if i simply import the System.windows.forms Namespace. Definitely this will help me to expose the class & methods, but will they work accordingly when get rendered. I am totally confused.. please help me. Thanks Simple answer:  You can't.  Webforms controls render as HTML; while this may be possible to achieve with Winforms controls by invoking the design-time rendering, I doubt it's going to work very well.What control are you trying to use?Peter BrunoneMS MVP, ASP.NETFounder, Easy...

Submitting data from a know web form to unknown web form
hi i m making a software in which i will submitt some data from a web page that will go to a web form of which contrlos are unknown to me only i know the name and how many controls in that form it means i can see the form only. how can i do this please help me soon with code plz its very argent.i m doin this wit the help of foxtrot.xray.WebRobot but its giving me error that this dll file is already exists in The file ('C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\_foxtrot.xray.WebRobot.dll' already exists).i don know what will do so please help me soon please thanks praveen We ca...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

synchronizing chunk of data of one web form for another web form
I'm making a web application. In one web form; i'm taking inputs from user. Now; there is some info given by user in this page which is needed for web form which is going to be displayed next. i want to display that info automatically on that web form so that user doesn't have to re-input that info in this next web form. Info from first page would be inserted into database when user clicks on the submit button. then that next web form would be displayed. and the chunk of info from previous page should be displayed there!!! how can i do this?? cany anybody help?? nobody can help me!! I...

Web Form and Web User Control
Hello, I have a Web User Control (ascx) that includes a button. This button has an onclick event method. This Web User control is included into a Web Form. (thru LoadControl). However, when I click on the button, the event method is not executed. What should I include in order it works fine? Thanks in advance. GAA. Using Loadcontrol is using dynamic controls and when using dynamic controls you must recreate the same dynamic controls ono postback to econstruct the page control tree. It is best if you do this during the Page PreInit event. How complex are your controls ...

Need Windows Form to Retrieve Information From Web Form
I have a cash and carry web site that customers can order products, the next day come in to the company to pay and pickup. I would like to create a windows application for the company to do two things: 1. download all the orders from the day before 2. upload price changes, product changes, category changes I've search the internet and forums and the only thing I can find that I think would actually link these two together would be a web service. Can you please tell me if I am heading in the right direction or if there is another method to link the two applications, if there are any pitf...

Problem in accessing web form data in user controls when create user control dynamically
HI. I have a problem using web user control. I designed a user control named NewsForm. This user control contains some web form elements like <asp:textbox>. When I add it in an .ASPX page, all things may be true. I can know which user filles in textbox (for example and other controls) <%@ Register TagPrefix="uc1" TagName="NewsForm" Src="NewsForm.ascx" %> and <UC1:NewsForm id="newsForm" runat="server"></UC1:NewsForm> But when i create it in code behined dynamically, however user control has web form controls but their value are blank for example //aspx co...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

Web resources about - user control data entry form, use same codebehind as web form? - asp.net.web-forms

ASP.NET - Wikipedia, the free encyclopedia
ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages . It was developed by Microsoft ...

C# dotnet SQL Editor (webform side)
Every time I need to develop a small business application I always try to choose the fastest and simplest way to implement it. This is why I ...

xClassNotDerivedFromElement – Another Non-Informative XAML Parse Error
... XAML is due to my lazyness. I Created a new xaml file but used the view template rather than a Resource Dictionary one, yes I deleted the codebehind ...

WPF Onyx
WPF Model-View-ViewModel framework.

Stronger Backbone - Part 2
... development, there was a framework called WebForms that developers would use to create web applications. WebForms used a system called "CodeBehind" ...

Use Custom Http Handlers To Improve Performance in ASP.NET
While reading a chapter from the upcoming book from Addison-Wesley entitled Essential ASP.NET with Examples in C# , I ran across a chapter on ...

Developing a Windows Phone Application using the MVVM Pattern
This documentation includes a companion sample application named PetrolTracker. PetrolTracker is an application written in Silverlight for Windows ...

Struggling for Competence
An event lets a publisher notify subscribers when something happens. The article examines event rules and convention, and presents a c# example. ...

CodeSOD: The Apex of T-SQL
... has all sorts of different ways to generate HTML. Rarely, it’s WebForms code living in as ASPX. Far more often, it’s hard-coded into the CodeBehind. ...

Happy Birthday, APRSdroid (my OSS Scala app for Android)!
APRSdroid is an Amateur Radio geo-location( APRS ) app for Android licensed under the GPL.It started as a Scala learning experience twoyears ...

Resources last updated: 1/7/2016 1:41:41 PM