Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

How Do i use this Javascript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iHavAQuestion - 24 Mar 2008 15:43 GMT
How can I use this same javascript in the asp.net 2.0, where I have a master
page.

<html  >
<script language="javascript" type="text/javascript">
function functionName(cnt_id)
{}
function functionName2
{}
</script>

<form id="form1" runat="server">
<body>

Date: <input runat="server" id="TextBox1" type="text"
onfocus="javascript:functionName('TextBox1')"/>

</body>
</form>
</html>
George Ter-Saakov - 24 Mar 2008 16:00 GMT
My guess you have a problem with changed id of the control....

There are several solutions but in your case you can use "this"
<script language="javascript" type="text/javascript">
function functionName(cnt)
{
   alert(cnt.id);
}
</script>

Date: <input runat="server" id="TextBox1" type="text"
onfocus="javascript:functionName(this);"/>

PS: also you can always use <%=TextBox1.ClinetID%>

PPS: Next try to point to a problem so we do not have to guess... :)

George.

> How can I use this same javascript in the asp.net 2.0, where I have a
> master
[quoted text clipped - 17 lines]
> </form>
> </html>
iHavAQuestion - 24 Mar 2008 16:21 GMT
I tried the same George before i posted the thread, but I ned to know, how do
I call the same javascript from the master page.

> My guess you have a problem with changed id of the control....
>
[quoted text clipped - 36 lines]
> > </form>
> > </html>
bruce barker - 24 Mar 2008 16:36 GMT
the master page is just a control on your page. you call javascript from it
just like any other control (there is no difference).

-- bruce (sqlwork.com)

> How can I use this same javascript in the asp.net 2.0, where I have a master
> page.
[quoted text clipped - 16 lines]
> </form>
> </html>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.