HTML Controls vs Web Form Controls


Hi,
I have a page with both controls (HTML and Web Form Controls). I am trying to use an html Calendar control and then get the date selected by the user and put into a Web form input field control. When I try to run this the HTML control cannot talk to the Web form control.
Any ideas?
Thanks.
0
jhweb
2/10/2005 12:12:10 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
966 Views

Similar Articles

[PageSpeed] 26

Can't you put some javascript in the HTML-control with which you assign the value to the ASP.NET Server control?

Please post some code so I can help u.

Kind Regards,

ThaYoung1!
0
ThaYoung1
2/10/2005 3:46:11 PM
Hi here is the Code.  Also I added a web form text input control and an html text control and created a function to copy the value from the web form control to the html control using java script.  Did not work.

Thanks for your help.

<%@ Page Language="Vbscript" AutoEventWireup="false" Codebehind="WOsearch.aspx.vb" Inherits="TECH_SUPPORT.WOsearch"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WOsearch</title>
<script language="javascript" type="text/javascript">
<!--
function selectedElement(elementx)
{
var testVar;
testVar = document.getElementById(elementx);
testVar.style.backgroundColor = "#9999cc";
testVar.style.fontWeight = "bold";
}
function unselectedElement(elementx)
{
var testVar;
testVar = document.getElementById(elementx);
testVar.style.backgroundColor = "transparent";
testVar.style.fontWeight = "normal";
}
function displayCalendar(elementx)
{
var varCalendar = document.getElementById(elementx);
varCalendar.style.visibility = "Visible";

}
function DateSelected(elementx)
{
var testVar;
var testVar2;
var dateVal1;
var txtDateVal;
testVar = document.getElementById('elementx');
testVar2 = document.getElementById('fldTo');
dateVal1 = new Date(testVar.value);
txtDateVal = dateVal1.toDateString()
txtDateVal = txtDateVal.substring(4);
var dateVal2 = new Date(txtDateVal);
var monthVal = dateVal2.getMonth() + 1
var dayVal = dateVal2.getDate()
var yearVal = dateVal2.getFullYear()
var convertedDate = monthVal + "/" + dayVal + "/" + yearVal
testVar2.value = convertedDate;

testVar.style.visibility = "Hidden";
}

function test(elementx)
{
var testVar;
var testVar2;
testVar = document.getElementById(elementx);
testVar2 = document.getElementById('fldFrom');
testvar2.value = testVar.value;

}

-->
</script>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:panel id="Panel1" style="Z-INDEX: 101; LEFT: 56px; POSITION: absolute; TOP: 64px" runat="server"
BackImageUrl="file:///C:\inetpub\wwwroot\HELPDESK\WebApplication6\TECH_SUPPORT\background1.jpg"
Width="184px" Height="128px">
<DIV id="lblWObyDate" onmouseover='selectedElement("lblWOByDate")' style="DISPLAY: inline; FONT-WEIGHT: normal; WIDTH: 184px; HEIGHT: 32px; BACKGROUND-COLOR: transparent; TEXT-ALIGN: left"
onmouseout='unselectedElement("lblWOByDate")' runat="server" ms_positioning="FlowLayout">Search
WOs by Date</DIV>
<DIV id="lblWObyNumber" onmouseover='selectedElement("lblWOByNumber")' style="DISPLAY: inline; WIDTH: 184px; HEIGHT: 32px; BACKGROUND-COLOR: transparent; TEXT-ALIGN: left"
onmouseout='unselectedElement("lblWOByNumber")' runat="server" ms_positioning="FlowLayout">Search
WO by Number</DIV>
<DIV id="lblWObySystems" onmouseover='selectedElement("lblWOBySystems")' style="DISPLAY: inline; WIDTH: 184px; HEIGHT: 32px; BACKGROUND-COLOR: transparent; TEXT-ALIGN: left"
onmouseout='unselectedElement("lblWOBySystems")' runat="server" ms_positioning="FlowLayout">Search
WOs by System</DIV>
<DIV id="lblWObyRequestor" onmouseover='selectedElement("lblWOByRequestor")' style="DISPLAY: inline; WIDTH: 184px; HEIGHT: 32px; BACKGROUND-COLOR: transparent; TEXT-ALIGN: left"
onmouseout='unselectedElement("lblWOByRequestor")' runat="server" ms_positioning="FlowLayout">Search
WOs by Requestor</DIV>
</asp:panel><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 256px; POSITION: absolute; TOP: 64px" runat="server"
Width="32px" Height="24px" Visible="False">From:</asp:label><asp:label id="Label2" style="Z-INDEX: 103; LEFT: 416px; POSITION: absolute; TOP: 64px" runat="server"
Width="16px" Height="24px" Visible="False">To:</asp:label><asp:label id="Label3" style="Z-INDEX: 104; LEFT: 256px; POSITION: absolute; TOP: 104px" runat="server"
Width="88px" Height="24px" Visible="False">WO Number:</asp:label><INPUT id="fldFrom" style="Z-INDEX: 105; LEFT: 296px; WIDTH: 112px; POSITION: absolute; TOP: 64px; HEIGHT: 24px"
type="text" size="13" runat="server"><INPUT id="fldTo" ondblclick='displayCalendar("htmlCalendar")' style="Z-INDEX: 106; LEFT: 440px; WIDTH: 112px; POSITION: absolute; TOP: 64px; HEIGHT: 24px"
type="text" size="13"><INPUT id="fldWO" style="Z-INDEX: 107; LEFT: 352px; WIDTH: 112px; POSITION: absolute; TOP: 104px; HEIGHT: 24px"
type="text" size="13">
<OBJECT id="htmlCalendar" oncellchange='DateSelected("htmlCalendar")' style="Z-INDEX: 108; LEFT: 256px; VISIBILITY: hidden; WIDTH: 296px; POSITION: absolute; TOP: 96px; HEIGHT: 160px"
classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" VIEWASTEXT>
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="7832">
<PARAM NAME="_ExtentY" VALUE="4233">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="-2147483633">
<PARAM NAME="Year" VALUE="2004">
<PARAM NAME="Month" VALUE="11">
<PARAM NAME="Day" VALUE="22">
<PARAM NAME="DayLength" VALUE="0">
<PARAM NAME="MonthLength" VALUE="0">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="1">
<PARAM NAME="GridCellEffect" VALUE="1">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="-2147483632">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="-1">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
<asp:TextBox id="TextBox1" style="Z-INDEX: 109; LEFT: 104px; POSITION: absolute; TOP: 264px"
runat="server" OnTextChanged='test("TextBox1")' Height="32px" Width="104px"></asp:TextBox>
</form>
</body>
</HTML>
0
jhweb
2/11/2005 12:22:01 AM
Reply:

Similar Artilces:

Web form Controls vs HTML controls
Hi, can anyone explain me the difference between Web Form Controls and HTML controls? What is their usability and disadvantages? Can i write code behind HTML controls?    Thanx in advance. Yes, you just have add "runat=server", in your HTML control. The Web Server Control, have more funtionality that the HTML controls. With Web Server Control, you can work easy with Data. Too, you have controls as AdRotator, WebCalendar and more... : http://samples.gotdotnet.com/quickstart/MCP Sergio Tarrillo Here are the Recommendations from Microsoft ....when to use 1 over the other...

Web Form Server Controls Vs. HTML controls
Hi1. What is the difference between Web Form Server controls and HTML controls with runat="server" attribute.e.g. <input type="text" id="mytext" runat="server"> Vs. <asp:TextBox id="mytext" />2. Why we should not use the normal HTML control instead of Server Controls since HTML controls are rendered on client side the performance in using them will be much better that using Web form server controls. Pls. can somebody explain this.- Anand one thing i know. there are much more options for the web controls. and web controls are easier to use than the http controls. for exampl...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

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...

how to call controls of web control form in coding of other forms?
hello everyone i have one problem i have created one webcontrol shoppingcart in which there are two labels one of qty and other of amt which are initially enable =falsenow on other page(aspx page) i have one txtbox of qty as txtqty i want tat as soon as user enters qty txtqty and clicks on add cart button it shd be display d value in lblqty of web control shopping cart make sure i m using datalist on aspx page so give me suggestions on tat basis and my coding is in vb. plz give ur suggestions as fast as possible. Neeti what do you mean by webcontrol.... it this user control or normal ...

Is there any web form control that can work as IFRAME html control?????
in html pages, we can use iframe control in which we can load another pages and/or folder explorer. now, i'm developing a web page in which i like to show the folder explorer when user clicks a link. as a prototype, i developed an html page like below: <html> <head><title>Using iFrame to browse a folder</title> </head> <body bgcolor=cyan> <table left=5px top=5px id=tabMain width=90% height=90% border=1 cellspacing=1 cellpadding=1> <tr height=100%> <td width=20% align=center valign=middle> <INPUT TYPE="Butto...

Mobile Web Controls vs. Web Controls
I am using VS2003 and I have realized that Mobile Web Controls are very basic and simple. So I saw in a post the way to use Web Controls inside Mobile Web Forms. Since then, I often use Web Controls instead of Mobile Web Controls. I put the Web Control inside a Mobile DeviceSpecific and put this DeviceSpecific inside a Mobile Panel. Why the Mobile Controls are so simple?  Does it happen the same in VS2005 or 2008? And, is it right to use only Web Controls inside Mobile Web Forms? Thanks. xesteban:Why the Mobile Controls are so simple?   They are simple because they suppor...

Web Form vs. Web Content Form
If you don't mind, I would like to know what is the difference between those two items, when I go to add a new item I see both of those and I don't know what the difference is.  A content form is for use with a masterpage. A web form is a standalone web page. If you select web content form, you will then have to specify a masterpage for it. and what is a master page used for?  Hi, a master page is used to give a constant look and theme to a site, without having to duplicate code. So basically you can put your header, menu, nav and footer on a master page. Then a...

HTML Controls vs Web Controls
Is there a cut and dry or "best practice" answer for when to use straight HTML, the HTML controls (runat=server), or the web controls? Thanks! You could have a look here: ASP.NET Server Controls Recommendations and here, perhaps: Introduction to ASP.NET Server Controls-- Mike PopeASP.NET User EducationThis posting is provided "AS IS" with no warranties, and confers no rights. Thanks!!!...

Web control in web control
Hi,There are two simple web user controls A and B, where B contains A. They just display the bunch of text boxes, so I do not need them even in tool pane. They sit in the same project next to web form.I noticed that web user control put on ASPX page does not appear in code behind, but if I create it with protected keyword and name being exactly the same as id it works fine. I can access such a web control from code behind and see the value assigned in IE. The problem is that the same routine does work for my A web control in B. When I assign the value IE, I keep getting null reference. ...

Html controls vs. Web controls
Can someone give me some examples if when it is best to use html controls over web controls and vice versa? Thanks, tdnxxx444 Web controls show up as <asp:class runat=server> (the "asp" may be replaced by other prefixes). They may have a corresponding HTML tag that they represent, but generally they are there to build all the HTML necessary for an idea. For example, something simple like the CheckBox web control still outputs several tags when you View Source: <span><input type=checkbox><label for>. Something like the Calendar control generates an en...

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 ...

How to access individual controls from a form containing the web user control containing those controls
 Below is a block of code in my .aspx form named default.aspx. In this form I load a web user control. I then add it to a place holder control.(Lines 3 and 4 below) So how do I access the individual controls in my web user control? I want to set the properties on those controls, but I am baffled as to how to access the control. For example I have a text label control named "label3". How do I access this control. Because for example, under certain situations I want to hide that control. ( Label3.Visible = false;)  1    if(!Page.IsPostBack) 2&nb...

Desktop Web Controls vs. Mobile Web Controls
Hi, after having a look at the posts in this forum about mobile issues, i still have some doubts. Hope someone can clarify this to me:VS2005 does not need MMIT (currently known as ASP .NET Mobile Controls) because it´s already included in 2.0 version, right?In VS2005, if i decide to build a web site to be accessible via a desktop browser or a mobile device, the right thing to do is use the asp .net web application template? In this case, the rendering is automatic depending on the device, correct?If i decide to create a web page to be accessible via a device browser, then, for now, i still h...

Web resources about - HTML Controls vs Web Form Controls - asp.net.web-forms

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Run-fests no more as bowlers take control in Adelaide
The extent to which batsmen struggled in Adelaide would have exceeded even the most pessimistic of forecasts.

ConnectSense Smart Outlet lets Siri control two HomeKit Wi-Fi wall sockets, USB charge iPads
... “smart plugs” previously released by iHome , ConnectSense has debuted the Smart Outlet with Apple HomeKit ($80) , which combines two Siri-controlled ...

‘Enough Is Enough’: Obama Demands More Gun Control After Colorado Shooting
President Obama again turned to gun control as a potential solution to the horrific act

Obama pushes for gun control after Colorado shooting
"This is not normal," president says after gunman fatally shoots three people, including police officer, at Planned Parenthood facility

Windows 10 vs. OS X: Which gives sys admins more control?
Now, nearly everything can be managed as if it were a mobile device, using APIs at the operating system for assured reach and consistent implementation ...

Boldin: Gabbert 'heck of a quarterback, he's poised, under control'
Skip to main content CSN Bay Area Header links TV Listings Contact App Email Follow Bar RSN login or register Login Search form Search 43° Navigation ...

Mind-Control Bacteria Stop You From Eating Too Much
Gut microbes release proteins that stop the brain from thinking you're still hungry.

Indonesia says pilot response to faulty rudder control caused AirAsia crash
Indonesia says pilot response to faulty rudder control caused AirAsia crash

Easy Power Supply Mod Takes Control
... supplies are great for the home hobbyist, featuring wide voltage range and current limiting for a low price. What’s not to love? The controls; ...

Resources last updated: 12/1/2015 11:05:11 PM