Click here to Skip to main content
15,913,669 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how design page Pin
Anubhava Dimri13-Jul-08 19:41
Anubhava Dimri13-Jul-08 19:41 
Questionin windows any tool like fileupload Pin
S.Aijaz13-Jul-08 18:22
S.Aijaz13-Jul-08 18:22 
AnswerRe: in windows any tool like fileupload Pin
sumit703413-Jul-08 18:36
sumit703413-Jul-08 18:36 
GeneralRe: in windows any tool like fileupload Pin
S.Aijaz13-Jul-08 18:39
S.Aijaz13-Jul-08 18:39 
GeneralRe: in windows any tool like fileupload Pin
sumit703413-Jul-08 18:44
sumit703413-Jul-08 18:44 
GeneralRe: in windows any tool like fileupload Pin
S.Aijaz13-Jul-08 18:47
S.Aijaz13-Jul-08 18:47 
GeneralRe: in windows any tool like fileupload Pin
sumit703413-Jul-08 18:53
sumit703413-Jul-08 18:53 
QuestionEvent not Firing on first click, but fires on second click Pin
Simerjots13-Jul-08 13:51
Simerjots13-Jul-08 13:51 
I am working on a page where I am synamicall creating controls, and then adding events to those controls.
Those events are not firing on the first click, but they are firing on th second click.



Here is my code for the page.


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using com.chrome.kp.configcompare3;
using System.Drawing;

public partial class new_build3 : System.Web.UI.Page
{
public master_MasterPage mast = new master_MasterPage();
public com.chrome.kp.configcompare3.Configuration configStyle;
protected void Page_Init(object sender,EventArgs e)
{
try
{
if (!IsPostBack)
{
ConstructData cd = new ConstructData();
HyperLink7.NavigateUrl = "/new/build5.aspx?styleid=" + Request["styleid"].ToString() + "&extcolor=" + Request["extcolor"].ToString() + "&int=" + Request["cobinationid"].ToString().Split('~')[0];
configStyle = (com.chrome.kp.configcompare3.Configuration)Session["configStyle"];
imgcar.ImageUrl = mast.convertmoney(configStyle.style.stockPhotoUrl.ToString());
lblmsrp.Text = mast.convertmoney(configStyle.style.baseMsrp.ToString());
lbloptions.Text = mast.convertmoney(configStyle.configuredOptionsMsrp.ToString());
lblinvoice.Text = mast.convertmoney(configStyle.style.baseInvoice.ToString());
lbltotal.Text = mast.convertmoney(configStyle.configuredTotalMsrp.ToString());
lbldest.Text = "(Includes Destination Charge: $" + configStyle.style.destination.ToString() + ") ";
lblextcolor.Text = Request.QueryString["extcolor"].ToString();
lblintcolor.Text = Request["cobinationid"].ToString().Split('~')[0];
if (Request["cobinationid"].ToString().Split('~')[1] != "")
{
SelectColorRequest colorReq = new SelectColorRequest();
colorReq.accountInfo = (AccountInfo)cd.configAccountInfo("US");
colorReq.combinationColorId = Request["cobinationid"].ToString().Split('~')[1];
colorReq.configurationState = configStyle.style.configurationState;
colorReq.returnParameters = null;


com.chrome.kp.configcompare3.ConfigurationElement newConfigStyle = cd.configService.selectColor(colorReq);
Session["configStyle"] = newConfigStyle.configuration;

}

}
}
catch { }


LoadOptions();

// img.Init += new System.EventHandler(imgb_Click);



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

}
private void LoadOptions()
{
com.chrome.kp.configcompare3.Configuration configStyle = (com.chrome.kp.configcompare3.Configuration)Session["configstyle"];
int ids = 0;
tblOptions.Rows.Clear();
Option[] options = configStyle.options;
Hashtable optionsHash = new Hashtable();
foreach (Option option in options)
{
String primaryDescription = "";
String extendedDescription = "";

foreach (OptionDescription od in option.descriptions)
{
if (od.type == OptionDescriptionType.PrimaryName)
{
primaryDescription = od.description;
}
else if (od.type == OptionDescriptionType.Extended)
{
extendedDescription = od.description;
}
}

String optionHeaderName = option.headerName;

String optionFields = option.selectionState.ToString() + "~" +
primaryDescription + "~" +
extendedDescription + "~" +
option.oemOptionCode + "~" +
option.chromeOptionCode + "~" +
option.invoice.ToString() + "~" +
option.msrp.ToString() + "~";


ArrayList optionsGroup = (ArrayList)optionsHash[ optionHeaderName ];
if (optionsGroup == null)
optionsGroup = new ArrayList();

optionsGroup.Add(optionFields);

//remove old arraylist group and replace with new
optionsHash.Remove(optionHeaderName);
optionsHash.Add(optionHeaderName, optionsGroup);
}
AccordionOptions.Panes.Clear();
bool isLight = true;
foreach (DictionaryEntry de in optionsHash)
{
String optionHeader = (String)de.Key;
if (optionHeader != "PAINT TYPE" )
{
AjaxControlToolkit.AccordionPane pane = new AjaxControlToolkit.AccordionPane();
Label head = new Label();
head.Text = optionHeader;
pane.HeaderContainer.Controls.Add(head);

Table tbl = new Table();
tbl.Font.Name = "Arial";
tbl.Width = 950;
tbl.Font.Size = 10;


ArrayList optionGroup = (ArrayList)de.Value;
foreach (String optionFields in optionGroup)
{
TableRow row = new TableRow();

if (isLight)
{
row.BackColor = Color.FromArgb(234, 234, 234);
isLight = false;
}
else
{
row.BackColor = Color.FromArgb(168, 168, 168);
isLight = true;
}

String optionState = optionFields.Split('~')[0];
String optionDesc = optionFields.Split('~')[1];
String optionExtDesc = optionFields.Split('~')[2];
String manufacturerOptionCode = optionFields.Split('~')[3];
String chromeOptionCode = optionFields.Split('~')[4];
String optionInvoice = optionFields.Split('~')[5];
String optionMsrp = optionFields.Split('~')[6];


TableCell cell = new TableCell();
cell.Text = optionDesc;

TableCell cell2 = new TableCell();
cell2.Text = manufacturerOptionCode;

TableCell cell3 = new TableCell();
cell3.Text = mast.convertmoney(optionMsrp);

TableCell cell4= new TableCell();
cell4.Text =mast.convertmoney(optionInvoice);
ids++;
ImageButton imgb = new ImageButton();
imgb.ID = chromeOptionCode+ids.ToString();
imgb.CommandName = chromeOptionCode;
imgb.Click += new ImageClickEventHandler(imgb_Click);
if (optionState == "Excluded")
{
imgb.ImageUrl = "/controls/construct/images/excluded.gif";
} else if ( optionState == "Included" ) {
imgb.ImageUrl = "/controls/construct/images/included.gif";
} else if ( optionState == "Required" ) {
imgb.ImageUrl = "/controls/construct/images/required.gif";
} else if ( optionState == "Selected" ) {
imgb.ImageUrl = "/controls/construct/images/selected.gif";
} else if ( optionState == "Unselected" ) {
imgb.ImageUrl = "/controls/construct/images/unselected.gif";
} else if ( optionState == "Upgraded" ) {
imgb.ImageUrl = "/controls/construct/images/upgraded.gif";
}

CheckBox ck = new CheckBox();
ck.ID = chromeOptionCode;

TableCell cell5 = new TableCell();
cell5.Controls.Add(imgb);
row.Cells.Add(cell5);
row.Cells.Add(cell);
row.Cells.Add(cell2);
row.Cells.Add(cell3);
row.Cells.Add(cell4);
tbl.Rows.Add(row);
if (optionExtDesc != null && optionExtDesc.Length > 0)
optionDesc += ", " + optionExtDesc;
}
pane.ContentContainer.Controls.Add(tbl);
AccordionOptions.Panes.Add(pane);
}
}



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

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

tblOptions.Rows.Clear();
OtherStuff os = new OtherStuff();
ConstructData cd = new ConstructData();
AccountInfo accountInfo = (AccountInfo)cd.configAccountInfo("US");
ImageButton imgb = (ImageButton)sender;
//get config style
com.chrome.kp.configcompare3.Configuration configStyle = (com.chrome.kp.configcompare3.Configuration)Session["configStyle"];
String originatingOptionCode = imgb.CommandName.ToString();

ToggleOptionRequest toggleRequest = new ToggleOptionRequest();
toggleRequest.accountInfo = accountInfo;
toggleRequest.configurationState = configStyle.style.configurationState;
toggleRequest.chromeOptionCode = originatingOptionCode;
toggleRequest.returnParameters = null;

ToggleOptionResponse optionToggleResponse = cd.configService.toggleOption(toggleRequest);
string ssnoption = null;
//save config style
com.chrome.kp.configcompare3.Configuration newConfigStyle = optionToggleResponse.configuration;
Session["configStyle"] = newConfigStyle;
configStyle = newConfigStyle;
int ids = 200;
PlaceHolder ph = new PlaceHolder();
if (optionToggleResponse.requiresToggleToResolve)
{

// resolveoptions.Value = "false";
String conflictingOptionsAndDescs = "";

//get conflicting option codes and descriptions
String[] conflictingOptions = optionToggleResponse.conflictResolvingChromeOptionCodes;
for (int i = 0; i < conflictingOptions.Length; i++)
{

String conflictingOptionCode = conflictingOptions[i];
if (i > 0 && i < conflictingOptions.Length)
conflictingOptionsAndDescs += ";;";

Option[] options = newConfigStyle.options;
for (int j = 0; j < options.Length; j++)
{//
Option option = options[j];
if (option.chromeOptionCode == conflictingOptionCode)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
String optionNameS = "";
for (int c = 0; c < option.descriptions.Length; c++)
{
if (option.descriptions[c].type == OptionDescriptionType.PrimaryName)
{
optionNameS = option.descriptions[c].description;
}
}
cell.Text = optionNameS;

TableCell cell2 = new TableCell();
cell2.Text = option.msrp.ToString();

TableCell cell3 = new TableCell();
cell3.Text = option.msrp.ToString();

TableCell cell4 = new TableCell();
cell4.Text = option.msrp.ToString();
ids++;


CheckBox ck = new CheckBox();
ck.ID= option.chromeOptionCode.ToString()+"1"+ ids.ToString();
ck.CheckedChanged += new EventHandler(imgb_Click);
ck.AutoPostBack = true;
ImageButton imgbb = new ImageButton();
imgbb.ID =option.chromeOptionCode.ToString();
imgbb.CommandName = option.chromeOptionCode.ToString();
imgbb.Click += new ImageClickEventHandler(imgb_Click1);
ssnoption = ssnoption+","+option.chromeOptionCode.ToString();

string optionState = option.selectionState.ToString();
if (optionState == "Excluded")
{
imgbb.ImageUrl = "/controls/construct/images/excluded.gif";
}
else if (optionState == "Included")
{
imgbb.ImageUrl = "/controls/construct/images/included.gif";
}
else if (optionState == "Required")
{
imgbb.ImageUrl = "/controls/construct/images/required.gif";
}
else if (optionState == "Selected")
{
imgbb.ImageUrl = "/controls/construct/images/selected.gif";
}
else if (optionState == "Unselected")
{
imgbb.ImageUrl = "/controls/construct/images/unselected.gif";
}
else if (optionState == "Upgraded")
{
imgbb.ImageUrl = "/controls/construct/images/upgraded.gif";
}

ph.Controls.Add(imgbb);
TableCell cell5 = new TableCell();
cell5.Controls.Add(imgbb);
row.Cells.Add(cell5);
row.Cells.Add(cell);
row.Cells.Add(cell2);
row.Cells.Add(cell3);
row.Cells.Add(cell4);
tbl_addOptions.Rows.Add(row);


String optionName = "";
for (int k = 0; k < option.descriptions.Length; k++)
{
if (option.descriptions[k].type == OptionDescriptionType.PrimaryName)
{
optionName = option.descriptions[k].description;
}
}
conflictingOptionsAndDescs += conflictingOptionCode + "::" + optionName;
break;
}
}
}
Session["imgbb"] =ph;
String manuCodeAndDesc = "";
for (int i = 0; i < newConfigStyle.options.Length; i++)
{
Option option = newConfigStyle.options[i];
if (String.Compare(option.chromeOptionCode, originatingOptionCode, true) == 0)
{
String optionName = "";
for (int j = 0; j < option.descriptions.Length; j++)
{
if (option.descriptions[j].type == OptionDescriptionType.PrimaryName)
{
optionName = option.descriptions[j].description;
}
}
manuCodeAndDesc = option.oemOptionCode + ";;" + optionName;
break;
}
}


}
imgcar.ImageUrl = mast.convertmoney(configStyle.style.stockPhotoUrl.ToString());
lblmsrp.Text = mast.convertmoney(configStyle.style.baseMsrp.ToString());
lbloptions.Text = mast.convertmoney(configStyle.configuredOptionsMsrp.ToString());
lblinvoice.Text = mast.convertmoney(configStyle.style.baseInvoice.ToString());
lbltotal.Text = mast.convertmoney(configStyle.configuredTotalMsrp.ToString());
lbldest.Text = "(Includes Destination Charge: $" + configStyle.style.destination.ToString() + ") ";
LoadOptions();
}


}
AnswerRe: Event not Firing on first click, but fires on second click Pin
Paul Conrad13-Jul-08 17:57
professionalPaul Conrad13-Jul-08 17:57 
Questionjavascript in asp.net submit button ---- deadline hanging on head Pin
dream_liner_7e713-Jul-08 12:12
dream_liner_7e713-Jul-08 12:12 
AnswerRe: javascript in asp.net submit button ---- deadline hanging on head Pin
Abhijit Jana13-Jul-08 17:06
professionalAbhijit Jana13-Jul-08 17:06 
GeneralRe: javascript in asp.net submit button ---- deadline hanging on head Pin
dream_liner_7e714-Jul-08 4:19
dream_liner_7e714-Jul-08 4:19 
QuestionHow to pass Query Strings to other page ? Pin
AprNgp13-Jul-08 5:07
AprNgp13-Jul-08 5:07 
AnswerRe: How to pass Query Strings to other page ? Pin
MoustafaS13-Jul-08 12:03
MoustafaS13-Jul-08 12:03 
GeneralRe: How to pass Query Strings to other page ? Pin
AprNgp14-Jul-08 7:07
AprNgp14-Jul-08 7:07 
QuestionUnable to display datagrid during runtime Pin
twistz13-Jul-08 3:34
twistz13-Jul-08 3:34 
AnswerRe: Unable to display datagrid during runtime Pin
Venkatesh Mookkan13-Jul-08 17:28
Venkatesh Mookkan13-Jul-08 17:28 
QuestionDirectory Delete Pin
.NET- India 13-Jul-08 1:37
.NET- India 13-Jul-08 1:37 
AnswerRe: Directory Delete Pin
Anubhava Dimri13-Jul-08 20:15
Anubhava Dimri13-Jul-08 20:15 
Questionan script error [modified] Pin
ptvce13-Jul-08 0:14
ptvce13-Jul-08 0:14 
AnswerRe: an script error Pin
Guffa13-Jul-08 10:48
Guffa13-Jul-08 10:48 
QuestionDiscussion Board Pin
raushan_913-Jul-08 0:02
raushan_913-Jul-08 0:02 
AnswerRe: Discussion Board Pin
sumit703413-Jul-08 19:47
sumit703413-Jul-08 19:47 
GeneralRe: Discussion Board Pin
raushan_913-Jul-08 20:51
raushan_913-Jul-08 20:51 
GeneralRe: Discussion Board Pin
sumit703413-Jul-08 22:40
sumit703413-Jul-08 22:40 

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.