Click here to Skip to main content
14,873,717 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Authentication Methods in ASP.NET? Pin
Arun Jacob27-Aug-09 18:38
MemberArun Jacob27-Aug-09 18:38 
Questionneed help! Pin
Seraph_summer27-Aug-09 10:10
MemberSeraph_summer27-Aug-09 10:10 
AnswerRe: need help! Pin
Abhishek Sur27-Aug-09 22:23
professionalAbhishek Sur27-Aug-09 22:23 
QuestionHow would I handle an Error with this piece of code. Pin
solutionsville27-Aug-09 10:08
Membersolutionsville27-Aug-09 10:08 
AnswerRe: How would I handle an Error with this piece of code. Pin
Robert_Pan27-Aug-09 14:40
MemberRobert_Pan27-Aug-09 14:40 
Questionproblem rendering placeholder with user controls added to it Pin
dd31415927-Aug-09 9:56
Memberdd31415927-Aug-09 9:56 
QuestionJavascript with multiple user controls Pin
dptalt27-Aug-09 9:30
Memberdptalt27-Aug-09 9:30 
AnswerRe: Javascript with multiple user controls Pin
DoctorMick28-Aug-09 0:17
MemberDoctorMick28-Aug-09 0:17 
You're have to prefix the function name and the control name with the unique id of the user control, e.g.


<%@ Control Language="C#"%>

<script type="text/javascript">

function <%=this.ClientId%>_TimeEntryHoursOnClick()
{
if (event.keyCode == 38)
document.getElementById("<%=this.ClientId%>_Text1").value = parseFloat(document.getElementById("<%=this.ClientId%>_Text1").value) + 1
}
</script>

<input id="<%=this.ClientId%>_Text1" önkeyup="<%=this.ClientId%>_TimeEntryHoursOnClick()" type="text" />


There are better ways of doing this tho such as moving the javascript function outside of the user control and passing the object being changed to the function, i.e.

<script type="text/javascript">

function TimeEntryHoursOnClick(theTextbox)
{
if (event.keyCode == 38)
theTextbox.value = parseFloat(theTextbox.value) + 1
}
</script>


<%@ Control Language="C#"%>
<input id="<%=this.ClientId%>_Text1" önkeyup="TimeEntryHoursOnClick(this)" type="text" />


I haven't tested the code above but it should work.
GeneralRe: Javascript with multiple user controls Pin
dptalt28-Aug-09 3:49
Memberdptalt28-Aug-09 3:49 
QuestionEvent Validation Pin
VengefulSakhmet27-Aug-09 9:21
MemberVengefulSakhmet27-Aug-09 9:21 
QuestionWhich button pressed Pin
ffowler27-Aug-09 9:09
Memberffowler27-Aug-09 9:09 
AnswerRe: Which button pressed Pin
Abhijit Jana27-Aug-09 9:15
professionalAbhijit Jana27-Aug-09 9:15 
GeneralRe: Which button pressed Pin
ffowler27-Aug-09 9:20
Memberffowler27-Aug-09 9:20 
GeneralRe: Which button pressed Pin
Abhijit Jana27-Aug-09 9:51
professionalAbhijit Jana27-Aug-09 9:51 
GeneralRe: Which button pressed Pin
ffowler27-Aug-09 10:02
Memberffowler27-Aug-09 10:02 
GeneralRe: Which button pressed Pin
Abhijit Jana27-Aug-09 10:14
professionalAbhijit Jana27-Aug-09 10:14 
QuestionNeed Suggestion Pin
amarnath n.n27-Aug-09 6:05
Memberamarnath n.n27-Aug-09 6:05 
AnswerRe: Need Suggestion Pin
Jay Royall27-Aug-09 6:26
MemberJay Royall27-Aug-09 6:26 
GeneralRe: Need Suggestion Pin
amarnath n.n27-Aug-09 13:21
Memberamarnath n.n27-Aug-09 13:21 
GeneralRe: Need Suggestion Pin
N a v a n e e t h27-Aug-09 19:52
MemberN a v a n e e t h27-Aug-09 19:52 
QuestionRetaining focus after postback Pin
rcampbell1227-Aug-09 6:04
Memberrcampbell1227-Aug-09 6:04 
AnswerRe: Retaining focus after postback Pin
Jeremy Likness27-Aug-09 6:17
professionalJeremy Likness27-Aug-09 6:17 
GeneralRe: Retaining focus after postback Pin
rcampbell1227-Aug-09 6:33
Memberrcampbell1227-Aug-09 6:33 
GeneralClient side validation is the way to go - Example given Pin
David Mujica27-Aug-09 7:43
MemberDavid Mujica27-Aug-09 7:43 
Questionupload and download Pin
hasani200727-Aug-09 5:15
Memberhasani200727-Aug-09 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.