|
the site contain introduction of company and terms of service usually.
these contents are not often changed.
Are these page designed static or dynamic?
hwo save these long text?
|
|
|
|
|
If your site is intracted by user means your site need database so u can use dynamic another use static.
|
|
|
|
|
Hi
is there any tool like fileupload in windows. actualy i need to upload picture files to a particular folder. i tried open file dialog but could not get idea how to use it for the same.
thanx
|
|
|
|
|
you can do it with the help of a textbox and file open dialog box
|
|
|
|
|
can you please tell me how? i mean to say which properties i have to set or which methods i have to use? actually i need to upload picture file and at the same time i need to insert its path into database.
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
If Windows.Forms.DialogResult.OK Then
TextBox1.Text = OpenFileDialog1.FileName
End If
End Sub
|
|
|
|
|
Sir i think here i can get path only but could not upload the file from some folder to my application's folder. how can i do that?
|
|
|
|
|
try
Application.StartupPath
|
|
|
|
|
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();
}
}
|
|
|
|
|
Please post only the suspect code that maybe causing the problem, rather than all of it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Can any one help me with the javascript part
protected void Button1_Click(object sender, EventArgs e)
{
/* The code to send values to database*/
/* AFTER SUCCESSFUL SENDING OF VALUES A JAVASCRIPT ALERT CONFIRMATION WITH OK BUTTON WHEN USER CLICK OK REDIRECT TO HOME.ASPX PAGE */
}
thanks in advance.
|
|
|
|
|
Try to use this idea !!!
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, "JavaScriptMethod();", true);
cheers,
Abhijit
|
|
|
|
|
Thanks Abhijit yr code worked perfectly, but last thing remaining is that when user click ok of the alert then redirect to home.aspx, can u plz help me.
|
|
|
|
|
I want to pass query string (name & value pair) to another page.
I am setting the query string as
QueryStringParameter q = new QueryStringParameter();
q.Name = "Poll";
q.QueryStringField = "1";
and redirect as
Response.Redirect("Poll.aspx");
What should I do, so that the query string (name & value pair) would become the part the url, and available at the other page ?
Apurv
|
|
|
|
|
Just do this :
Response.Redirect("poll.aspx?"+name+"="+val);
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Get fresh data
DataGrid1.DataSource = Test();
//Bind to grid
DataGrid1.DataBind();
}
}
protected DataTable Test()
{
//Create new table object
DataTable dt = new DataTable();
dt.TableName = "Name";
//Create new column object
DataColumn dc = new DataColumn();
//Set the properties for the column
dc.ColumnName("Code");
dc.DataType = System.Type.GetType("System.Int32");
dc.DefaultValue = 0;
//Add new column
dc = new DataColumn("Name", System.Type.GetType("System.String"));
dc.DefaultValue = string.Empty;
dc.Caption = "Name";
dt.Columns.Add(dc);
//Create new row object
DataRow dr = new DataRow();
dr = dt.NewRow();
dr["Code"] = 001;
dr["Name"] = "Tan Teck Wah";
//Add new row
dr = new DataRow();
dr["Code"] = 002;
dr["Name"] = "Joseph Lin";
dt.Rows.Add(dr);
return dt;
}
//Display Data
private string GetTableData(DataTable dt)
{
StringBuilder TableData = new StringBuilder();
// retrieve header row column labels
TableData.AppendFormat("Row");
foreach (DataColumn dc in dt.Columns)
TableData.AppendFormat("\t{0}", dc.ColumnName);
TableData.AppendFormat("\n");
// retrieve rows
int j = -1;
foreach (DataRow dr in dt.Rows)
{
TableData.AppendFormat("[{0}]",++j);
foreach (DataColumn dc in dt.Columns)
{
TableData.AppendFormat("\t{0}", dr[dc] );
}
TableData.AppendFormat("\n");
}
return TableData.ToString();
}
}
there isnt any error when debug, however was unable to display the datagrid during runtime.
|
|
|
|
|
Seems like the DataSource has empty data. Are you sure that your DataTable has rows because I don't see any piece of code which is loading the DataTable with data.
In a DataGrid, if the DataSource is empty, the DataGrid will not show up. Use GridView control with has EmptyRowTemplate which will automatically show up if the DataSource doesn't has values.
|
|
|
|
|
I want to delete the directory which is having two images. So for deleting the directory i'm deleting images first but still after deleting the images my directory showing it's size 42.kb but the directory is having nothing. Due to this problem i cann't delete the directory and it's throwing the error "The directory is not empty"
So now plz tell me how to delete this directory
|
|
|
|
|
You are Deleting file using DOS Command.
So skip it and Delete Folder Using Windows Command.
System.IO.Directory.Delete
Thanks
|
|
|
|
|
i want when i click on button i see an alert with ok button and when i click ok it goes to this url:www.yahoo.com
i wrote this but it has error:
btnAccept.Attributes.Add("OnClick", "input_box=alert(\"saved.\");if (input_box==true){location.replace("http://www.yahoo.com");}");
modified on Sunday, July 13, 2008 6:29 AM
|
|
|
|
|
An alert only has an ok button, so the window.alert method doesn't return anything.
If you want the option to cancel the operation, you use the window.confirm method instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
|
really.....
why u havent given answer...
|
|
|
|