473,765 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How use WebUserControl

Hi

I create WebUserControl and very confused when use control

For Example:

*************** **************
*wuc.ascx
*************** **************
<script id=clientEventH andlersJS language=javasc ript>
<!--

function selMap_onclick( ) {
//???? here is my problem
}

//-->
</script>
<%@ Control Language="vb" AutoEventWireup ="false" Codebehind="wuc .ascx.vb"
Inherits="local host.wuc"
targetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<div id="divSelMap" runat="server">
<SELECT size="5" style="WIDTH: 100%; HEIGHT: 100%" id="selMap"
name="selMap" runat="server" language=javasc ript onclick="return
selMap_onclick( )">
</SELECT>
</div>

*************** **************
* test.aspx
*************** **************
<%@ Register TagPrefix="uc1" TagName="wuc" Src="wuc.ascx" %>
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="tes t.aspx.vb"
Inherits="local host.test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
............... ............... ............... .........
</HEAD>
<body MS_POSITIONING= "FlowLayout " topmargin="0" bottommargin="0 "
leftmargin="0" rightmargin="0" >
<form id="Form1" method="post" runat="server"
action="test.as px?wuc=MapPrewi ev">
<uc1:wuc id="Wuc" runat="server"> </uc1:wuc>
</form>
</body>
</HTML>

*************** **************
* In Internet Explorer -> ViewSource I see that:
*************** **************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
............... ............... ............... .........
............... ............... ............... .........
</HEAD>
<body MS_POSITIONING= "FlowLayout " topmargin="0" bottommargin="0 "
leftmargin="0" rightmargin="0" >
<form name="Form1" method="post" action="test.as px" id="Form1">
............... ............... ............... .........
............... ............... ............... .........
<script id=clientEventH andlersJS language=javasc ript>
<!--
function selMap_onclick( ) {
//???? here is my problem
}
//-->
</script>

<div id="Wuc_divSelM ap"
style="DISPLAY: yes;Z-INDEX:99;LEFT:1 50px;WIDTH:200p x;POSITION:abso lute;TOP:20px;H EIGHT:150px;">
<select name="Wuc:selMa p" id="Wuc_selMap " size="5" style="WIDTH: 100%;
HEIGHT: 100%" language="javas cript" onclick="return selMap_onclick( )">
<option value="Bulgaria ">Bulgaria</option>
<option value="Sofia&Ne ighbours">Sofia &Neighbours</option>
<option value="Europa"> Europa</option>
<option value="Sofia">S ofia</option>
<option value="Blagoevg rad">Blagoevgra d</option>
<option value="Burgas"> Burgas</option>
<option value="Haskovo" >Haskovo</option>
</select>
</div>
</form>
</body>
</HTML>

The "<SELECT>" in end source from IE have new NAME="Wuc:selMa p" and
ID="Wuc_selMap "
I don`t know what i do when place WebUserControl in other page (test2.aspx)
with other "TagName=", or when I use this WebUserControl several thimes in
one page???
Nov 19 '05 #1
1 1973
Hi I know a little about this as I have created one and used it throughout my
web application. To add it to a form simply drag it from the solution
explorer to the form and position it in the desired location. To get to its'
properties, for example if you want to hide or display the control
conditionally in the vb file add something like
For Each ctrl As Control In Me.Controls
ctrl.FindContro l("usercontroln ame").Visible = False
Next
--
Paul G
Software engineer.
"DichkoSoft " wrote:
Hi

I create WebUserControl and very confused when use control

For Example:

*************** **************
*wuc.ascx
*************** **************
<script id=clientEventH andlersJS language=javasc ript>
<!--

function selMap_onclick( ) {
//???? here is my problem
}

//-->
</script>
<%@ Control Language="vb" AutoEventWireup ="false" Codebehind="wuc .ascx.vb"
Inherits="local host.wuc"
targetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<div id="divSelMap" runat="server">
<SELECT size="5" style="WIDTH: 100%; HEIGHT: 100%" id="selMap"
name="selMap" runat="server" language=javasc ript onclick="return
selMap_onclick( )">
</SELECT>
</div>

*************** **************
* test.aspx
*************** **************
<%@ Register TagPrefix="uc1" TagName="wuc" Src="wuc.ascx" %>
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="tes t.aspx.vb"
Inherits="local host.test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
............... ............... ............... .........
</HEAD>
<body MS_POSITIONING= "FlowLayout " topmargin="0" bottommargin="0 "
leftmargin="0" rightmargin="0" >
<form id="Form1" method="post" runat="server"
action="test.as px?wuc=MapPrewi ev">
<uc1:wuc id="Wuc" runat="server"> </uc1:wuc>
</form>
</body>
</HTML>

*************** **************
* In Internet Explorer -> ViewSource I see that:
*************** **************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
............... ............... ............... .........
............... ............... ............... .........
</HEAD>
<body MS_POSITIONING= "FlowLayout " topmargin="0" bottommargin="0 "
leftmargin="0" rightmargin="0" >
<form name="Form1" method="post" action="test.as px" id="Form1">
............... ............... ............... .........
............... ............... ............... .........
<script id=clientEventH andlersJS language=javasc ript>
<!--
function selMap_onclick( ) {
//???? here is my problem
}
//-->
</script>

<div id="Wuc_divSelM ap"
style="DISPLAY: yes;Z-INDEX:99;LEFT:1 50px;WIDTH:200p x;POSITION:abso lute;TOP:20px;H EIGHT:150px;">
<select name="Wuc:selMa p" id="Wuc_selMap " size="5" style="WIDTH: 100%;
HEIGHT: 100%" language="javas cript" onclick="return selMap_onclick( )">
<option value="Bulgaria ">Bulgaria</option>
<option value="Sofia&Ne ighbours">Sofia &Neighbours</option>
<option value="Europa"> Europa</option>
<option value="Sofia">S ofia</option>
<option value="Blagoevg rad">Blagoevgra d</option>
<option value="Burgas"> Burgas</option>
<option value="Haskovo" >Haskovo</option>
</select>
</div>
</form>
</body>
</HTML>

The "<SELECT>" in end source from IE have new NAME="Wuc:selMa p" and
ID="Wuc_selMap "
I don`t know what i do when place WebUserControl in other page (test2.aspx)
with other "TagName=", or when I use this WebUserControl several thimes in
one page???

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1630
by: Christian | last post by:
Hi, I try to change the position of a WebUserControl on my WEbform (layout is set to GridLayout) by changing the absolute position in the html-code but it does not work. When I change the position at design-time for my user control by changing it directly in html-code is the change reflected in the design view (and vice-versa). But when I run the app is the control always positioned at the same location (somewhere topleft on the page)
0
1001
by: Mike Levin | last post by:
Hello Group, I'm using VisualStudio.NET and put a DataGrid into a WebUserControl (an ascx file). For the DataGrid element, I have set AllowSorting="True" and OnSortCommand="Grid_Sort".
2
2109
by: Arun | last post by:
I am new to ASP.NET I need some help for this scenario The scenario is like this I have a template Page which loads a WebUserControl (uct1.ascx) inside a PlaceHolder (PH1) Now this Web User Control (uct1.ascx) has a table with 2 rows First row has a 5 text boxes 2 Combobox and 6 buttons (all Server Controls)
0
1119
by: Christian H | last post by:
Hello, I've just created a WebUserControl that consists of a few other controls such as DropDownList, TextBox and Button. Based on the information entered in the DropDownlist, and TextBox, the Button.onClick event quries a database, and returns a DataTable. Because I'm going to use this control different places, and bind the DataTable in different ways (sometimes a datagrid, sometimes repeater) , I added a delegate...
2
275
by: Oren | last post by:
Hello everyone... I have a simple WebUserControl with Button and TextBox on it. Webform1.aspx contains this WebUserControl. How can I create my own C'tor for this WebUserControl - I mean when I run Webform1.aspx I want to send data to the UserControl (fill Textbox1.Text). any samples ? thanx,
2
315
by: Oren | last post by:
Hi everyone, I have WebUserControl on a Webform. How can I sent dynamically to the WebUserControl from a Function/Property on the Webform ? <uc:myuc id="myid1" CurrentPage=<%#GetText()%> data="2" runat="server"/> ..... GetText()-> function/property on the Webform, returns string and send it to the WebUserControl -> <%#GetText()%>
0
1180
by: Giovanni | last post by:
Dear Friends, I have a decision to make and hope to get some insight: I have built several WebUserControls one of which is a WebUserControl that queries an SQL server database, retrieves a filename and loads an image control. The WebUserControl itself contains an SQLDataSource and an image box. I also have other WebUserControls that implement the same concept as previously mentioned. The SQLDataSource is bound to a session variable...
0
1102
by: Klaus Jensen | last post by:
Hi In a repeater-control, in the <SeparatorTemplatei have placed a webusercontrol, I have made. That works great- However, I want to know be able to only display this WebUserControl a certain number of times. Basicly I need the WebUserControl itself to know, how many other instances of the webusercontrol was displayed on the page, when I run it.
1
1185
by: deeparengan | last post by:
hi in asp.net i have a webusercontrol that has three dropdownlist.In the first dropdownlist i loaded the data at design time and in second dropdownlist i load the some data at run time according to the selected value in first drop downlist and in the third i loaded the values none,and,or. I want coding to display same webusercontrol while i click the values and,or in third dropdownlist placed in webusercontrol.
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.