473,231 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

How use WebUserControl

Hi

I create WebUserControl and very confused when use control

For Example:

*****************************
*wuc.ascx
*****************************
<script id=clientEventHandlersJS language=javascript>
<!--

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

//-->
</script>
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="wuc.ascx.vb"
Inherits="localhost.wuc"
targetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

*****************************
* test.aspx
*****************************
<%@ Register TagPrefix="uc1" TagName="wuc" Src="wuc.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb"
Inherits="localhost.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.aspx?wuc=MapPrewiev">
<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.aspx" id="Form1">
.................................................. ....
.................................................. ....
<script id=clientEventHandlersJS language=javascript>
<!--
function selMap_onclick() {
//???? here is my problem
}
//-->
</script>

<div id="Wuc_divSelMap"
style="DISPLAY:yes;Z-INDEX:99;LEFT:150px;WIDTH:200px;POSITION:absolute; TOP:20px;HEIGHT:150px;">
<select name="Wuc:selMap" id="Wuc_selMap" size="5" style="WIDTH: 100%;
HEIGHT: 100%" language="javascript" onclick="return selMap_onclick()">
<option value="Bulgaria">Bulgaria</option>
<option value="Sofia&Neighbours">Sofia&Neighbours</option>
<option value="Europa">Europa</option>
<option value="Sofia">Sofia</option>
<option value="Blagoevgrad">Blagoevgrad</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:selMap" 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 1941
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.FindControl("usercontrolname").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=clientEventHandlersJS language=javascript>
<!--

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

//-->
</script>
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="wuc.ascx.vb"
Inherits="localhost.wuc"
targetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

*****************************
* test.aspx
*****************************
<%@ Register TagPrefix="uc1" TagName="wuc" Src="wuc.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb"
Inherits="localhost.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.aspx?wuc=MapPrewiev">
<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.aspx" id="Form1">
.................................................. ....
.................................................. ....
<script id=clientEventHandlersJS language=javascript>
<!--
function selMap_onclick() {
//???? here is my problem
}
//-->
</script>

<div id="Wuc_divSelMap"
style="DISPLAY:yes;Z-INDEX:99;LEFT:150px;WIDTH:200px;POSITION:absolute; TOP:20px;HEIGHT:150px;">
<select name="Wuc:selMap" id="Wuc_selMap" size="5" style="WIDTH: 100%;
HEIGHT: 100%" language="javascript" onclick="return selMap_onclick()">
<option value="Bulgaria">Bulgaria</option>
<option value="Sofia&Neighbours">Sofia&Neighbours</option>
<option value="Europa">Europa</option>
<option value="Sofia">Sofia</option>
<option value="Blagoevgrad">Blagoevgrad</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:selMap" 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
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...
0
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
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...
0
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...
2
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...
2
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()%>...
0
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...
0
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...
1
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.