i have a div..inside the div i have an image and name..now when i will click on the div the div will have a server side click that means it will have a codebehind function..how to do it?? or how to make my div a button where i don't have to change my div...
my code
<div class="tutorial" style="margin-left:5px;">
TUTORIAL<div class="firstico" style="margin-left:70px;margin-top:-17px;">
</div>
</div>
how can i have a server side onclick function of this div???
i have used like that but it didn't work for me..don't know why??
<div class="tutorial" style="margin-left:5px;"
runat="server" id="tutorial" onClick="tutorial_Click">
TUTORIAL<div class="firstico" style="margin-left:70px;margin-top:-17px;">
</div>
</div>
private void tutorial_Click(object sender, System.EventArgs e){
// do stuff
}
i have tried like that also but it also didn't work for me...
<div class="tutorial" style="margin-left:5px;"
onclick="__doPostBack('tutorial', 'click');">
TUTORIAL<div class="firstico" style="margin-left:70px;margin-top:-17px;">
</div>
</div>
private void PageLoad(object sender, System.EventArgs e){
// sttufs
[...]
// my stuff for tutorial click
if (Request["__EVENTTARGET"] == "tutorial" && Request["__EVENTARGUMENT"] == "click"){
TutorialClicked();
}
}
private void TutorialClicked(){
iframestyle.Attributes["src"] = "userpage.aspx";
}