Click here to Skip to main content
15,847,263 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
HedwigO13-Jun-17 6:22
HedwigO13-Jun-17 6:22 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
Richard Deeming13-Jun-17 6:27
mveRichard Deeming13-Jun-17 6:27 
QuestionWebAPI: When to use multiple endpoint or multiple route for single action Pin
Mou_kol8-Jun-17 23:54
Mou_kol8-Jun-17 23:54 
AnswerRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
Richard MacCutchan9-Jun-17 1:24
mveRichard MacCutchan9-Jun-17 1:24 
AnswerRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
F-ES Sitecore9-Jun-17 4:58
professionalF-ES Sitecore9-Jun-17 4:58 
GeneralRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
Mou_kol12-Jun-17 4:42
Mou_kol12-Jun-17 4:42 
QuestionWeb API: different way of attribute routing Pin
Mou_kol8-Jun-17 6:05
Mou_kol8-Jun-17 6:05 
Questionuser control Pin
caradri8-Jun-17 4:01
caradri8-Jun-17 4:01 
hi all.
I add in a loop many user controls and i see them on screen, but when a click is performed in one of them, all of the fires the click event.
I'm new in asp.net, so if you see coding horrors be nice.
Thanks
here i add the controls


protected void Page_Load(object sender, EventArgs e)
{



AddProgressBarForPN(3, "rev123", "pndesc123", "pn123");
AddProgressBarForPN(2, "rev12", "pndesc12", "pn12");
AddProgressBarForPN(1, "rev1", "pndesc1", "pn1");
}


void prog_ProgressBarBttnClicked(string stempID,string pn)
{
support.Logs(stempID +" "+pn, "prog_ProgressBarBttnClicked", false);
}


protected void cloneBttn_Click(object sender, EventArgs e)
{
}

private void AddProgressBarForPN(int step,string rev,string pn_desc,string pn)
{

prog = (ProgressBarControl)LoadControl("~/ProgressBarControl.ascx");

prog.ProgressBarBttnClicked += prog_ProgressBarBttnClicked;

prog.Step = step;
prog.Revision = rev;
prog.PN_Description = pn_desc;
prog.ClientName = pn_desc;
prog.PN = pn;

HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell1 = new HtmlTableCell();
cell1.Controls.Add(prog);

row.Cells.Add(cell1);
mainTable.Rows.Add(row);

and this is the control html


var idd;
function getID(oObject) {
idd = oObject.id;
var hdnfldVariable = document.getElementById('hdnfldVariable');
__doPostBack(idd);
}



table, th, td
{
color:darkblue;
margin-top:-15px;
}

<asp:hiddenfield id="hdnfldVariable" runat="server">
<asp:table style="width:100%;margin-top:15px" id="mainTable" runat="server">
<asp:tablerow>
<asp:tablecell>


PN: <%=this.PN %> / Client: <%=this.ClientName %> / Description: <%=this.PN_Description %> / Rev: <%=this.Revision %>


  1. <%-- onclick="StepClicked(this)"--%>
    1
    Collect files



  2. 2
    Software preparation



  3. 3
    Debug



  4. 4
    Validation



  5. 5
    Release







and control code behind

public delegate void ProgreesBarButton(string stepID,string PN);
public event ProgreesBarButton ProgressBarBttnClicked = delegate { };

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.GetPostBackEventReference(this, string.Empty);

var arg = Request.Form["__EVENTTARGET"];

if(arg != null)
{
string progBttnID = arg.ToString();

ProgressBarBttnClicked(progBttnID,PN);
}
}

public string ClientName{ get; set; }
public string PN_Description{ get; set; }
public string PN{ get; set; }
public string Revision{ get; set; }

public string step1 { get; set; }
public string step2 { get; set; }
public string step3 { get; set; }
public string step4 { get; set; }
public string step5 { get; set; }

int step;
public int Step
{
get { return step;}
set
{
step = value;
for (int i = 1; i <= step; i++)
{
switch (i)
{
case 1:
step1 = "active";
break;
case 2:
step2 = "active";
break;
case 3:
step3 = "active";
break;
case 4:
step4 = "active";
break;
case 5:
step5 = "active";
break;
}
}

for (int i = step+1; i <= 5; i++)
{ switch (i)
{
case 1:
step1 = "";
break;
case 2:
step2 = "";
break;
case 3:
step3 = "";
break;
case 4:
step4 = "";
break;
case 5:
step5 = "";
break;
}
}
}
}

public void StepClicked(string stepid)
{
ProgressBarBttnClicked(stepid, PN);
}

modified 8-Jun-17 9:09am.

QuestionQuestion regarding asp.net web forms Pin
Member 132480908-Jun-17 2:52
Member 132480908-Jun-17 2:52 
AnswerRe: Question regarding asp.net web forms Pin
Afzaal Ahmad Zeeshan8-Jun-17 6:38
professionalAfzaal Ahmad Zeeshan8-Jun-17 6:38 
GeneralRe: Question regarding asp.net web forms Pin
ZurdoDev8-Jun-17 6:43
professionalZurdoDev8-Jun-17 6:43 
GeneralRe: Question regarding asp.net web forms Pin
Afzaal Ahmad Zeeshan8-Jun-17 6:49
professionalAfzaal Ahmad Zeeshan8-Jun-17 6:49 
GeneralRe: Question regarding asp.net web forms Pin
ZurdoDev8-Jun-17 6:53
professionalZurdoDev8-Jun-17 6:53 
GeneralRe: Question regarding asp.net web forms Pin
Member 1324809013-Jun-17 2:13
Member 1324809013-Jun-17 2:13 
QuestionObjectDataSource Pin
pollilop7-Jun-17 6:10
pollilop7-Jun-17 6:10 
AnswerRe: ObjectDataSource Pin
Richard Deeming7-Jun-17 7:12
mveRichard Deeming7-Jun-17 7:12 
GeneralRe: ObjectDataSource Pin
pollilop11-Jun-17 23:35
pollilop11-Jun-17 23:35 
SuggestionRe: ObjectDataSource Pin
Yoqueuris13-Jun-17 6:04
Yoqueuris13-Jun-17 6:04 
Questioni have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Member 107737173-Jun-17 21:32
Member 107737173-Jun-17 21:32 
AnswerRe: i have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Richard Deeming5-Jun-17 9:37
mveRichard Deeming5-Jun-17 9:37 
QuestionUsing Base Model in Shared View Pin
Farhad Eft3-Jun-17 0:16
Farhad Eft3-Jun-17 0:16 
AnswerRe: Using Base Model in Shared View Pin
User 41802543-Jun-17 4:40
User 41802543-Jun-17 4:40 
GeneralRe: Using Base Model in Shared View Pin
Farhad Eft3-Jun-17 6:39
Farhad Eft3-Jun-17 6:39 
QuestionHow codeproject registration page showing client timezone as selected in dropdown Pin
Mou_kol2-Jun-17 1:07
Mou_kol2-Jun-17 1:07 
AnswerRe: How codeproject registration page showing client timezone as selected in dropdown Pin
Richard Deeming2-Jun-17 2:14
mveRichard Deeming2-Jun-17 2:14 

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.