|
I suggest you just throw the exception.
Regards,
Prakash Kalakoti
|
|
|
|
|
Response.Redirect causes a ThreadAbortException to be thrown. That's how the framework knows to stop processing the page and do the redirect. If you're going to call Response.Redirect within a try/catch block, you need to explicitly catch the ThreadAbortException and rethrow it.
try
{
Response.Redirect("welcome.aspx");
}
catch (System.Threading.ThreadAbortException)
{
throw;
}
catch (Exception ex)
{
Response.Output.Write(ex.ToString());
}
Jon Sagara
I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So i had to leave the place as soon as possible.
--Mr.Prakash
Blog | Site | Articles
|
|
|
|
|
Dear all
I used to use repeater controls in vs2003 with no problem
No when i'm usin the same code wth vs2005 i get errors on databinder.eval(container....
there is a problem with teh "container"
How can this be solved
And is there any sample or example for repeater control on visual studio 2005?
I would appreciate quick response
Thanx in advance
Best Regards
3ala2
|
|
|
|
|
guess i got it
instear of container.dataitem we use container and dataitem.something
Thanx anyway
Best Regards
3ala2
|
|
|
|
|
Hi,
I am using LDAP to add users into Active directory. But even if i add same email id's for different users its accepting. but i have to avoid that. It should not accept same emailid for different users. Please help me how to validate this.
Code using to add users:
public bool AddEmployee(string Path, string employeeId, string employeeName, string newFirstName, string newLastName, string password, string designation, string mobilePhone, string officeEmail, string personalEmail, string reportTo, string newEmpStreet, string newEmpCity,string newEmpCountry, string newEmpPinCode, string dateOfJoin,string personalPhone)
{
DirectoryEntry oContainer, oNewUser;
try
{
//Bind to the parent container
oContainer = new DirectoryEntry(Path);
//add this to ads
// oNewUser = oContainer.Children.Add("CN=" + strFirstName + " " + strLastName, "user");
// oNewUser = oContainer.Children.Add("CN=" + employeeName + " " + employeeName, "user");
oNewUser = oContainer.Children.Add("CN=" + newFirstName + " " + newLastName, "user");
//SAMAccountName is required!
oNewUser.Properties["sAMAccountName"].Add(employeeName);
oNewUser.Properties["sn"].Add(newLastName);
oNewUser.Properties["givenName"].Add(newFirstName);
// oNewUser.Properties["initials"].Value = "T";
oNewUser.Properties["description"].Value = employeeId;
oNewUser.Properties["title"].Value = designation;// "sample-Operation";
oNewUser.Properties["physicalDeliveryOfficeName"].Value = "40/5802";
oNewUser.Properties["telephoneNumber"].Value = mobilePhone;// "(425)222-9999";
oNewUser.Properties["mail"].Value = officeEmail;// "vts@vts.com";
// oNewUser.Properties["Manager"].Value = reportTo;
oNewUser.Properties["mobile"].Value = personalPhone;// "";
oNewUser.Properties["streetAddress"].Value = newEmpStreet;// "4 th street";
oNewUser.Properties["postOfficeBox"].Value = newEmpStreet;// "dd-12";
oNewUser.Properties["l"].Value = newEmpCity;// "thennur";
// oNewUser.Properties["st"].Value = "trichy";
oNewUser.Properties["postalCode"].Value = newEmpPinCode;// "620017";
oNewUser.Properties["c"].Value = newEmpCountry;// "IN";
oNewUser.Properties["url"].Value = personalEmail;
oNewUser.Properties["pager"].Value = dateOfJoin;
//This will enable the account:
oNewUser.Properties["userAccountControl"].Add(544);//544
//Save the Changes
oNewUser.CommitChanges();
//Set Password
oNewUser.Invoke("SetPassword", new string[] { password });
return true;
}
Thanks in Advance,
Regards,
Prya
|
|
|
|
|
I'm using Gridview for display some student details, i need allow them to edit the data i have set Edit,Update,Cancel command in CommandField and seted the update coding for event also,but my problem is when i edit the edit button it is allow me to edit that purticular cell(that mean its not view text box in the gridview),so what should i give the coding for in RowEditing event.Pls help me to do this
Thanks.
|
|
|
|
|
where does exactly diff comes
submit button
Input button type
|
|
|
|
|
Ok, first let me try to write your question for you:
What is the difference between a button (input tag) with type="submit" and one with type="button"?
Is that what you tried to write? I'm not completely sure, as what you wrote completely lacks any grammar, so I mostly based it on the words "diff", "submit", "button", "Input" and "type" from your post.
If it was, then the answer is that the "submit" button is used to submit the form that it is placed in, while the "button" button is used to run the Javascript in it's onclick event.
---
Year happy = new Year(2007);
|
|
|
|
|
How can i open new page in new window without close the parent
MD_NADA
|
|
|
|
|
set the attribute target = _blank...
<< >>
|
|
|
|
|
Thanks for help
but it works with hyperlink
i want 2 write code under button
MD_NADA
|
|
|
|
|
hi,
You can do something like
<asp:Button ... OnClientClick="javascript:window.open(...);return false;" ...
edit:
Substitute "removed" with "OnClientClick". &@#%$#%$%@ script kiddies.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Hi i want to add mouseout & mouseover events on the drop down list's each item. i tried following
code in drop down list's itemdatabound event ...
e.item.cell[x].attribute.add("onmouseover","this.style.backgroundColor='red';");
but this doesn't effect on event.
please help me
Thanks & Regards,
SAMir Nigam,
Software Developer,
STPL, Lucknow, India.
|
|
|
|
|
hi all.
i m using calendar control in ASP.NET.
pls tell me how to validate it using javascript.
i want to make it mandatory to select a date..
thanks in advance.
There's never a Wronge Time To Do The Right Thing !!
|
|
|
|
|
Hi CodeBugs,
Can some one suggest me how to attach Crystal Report Data as an attachment to the SMTP Mail.
I want to do it without actually exporting Crystal report data in to one of the available format and then attaching it as an attachment file.
Awaing for a prompt reply...
Thanks in advance.
Vijay
Vijay Patil
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("connection string");
DataSet ds = new DataSet();
DataTable dt = new DataTable("tblcheck");
DataColumn dc1=new DataColumn("col1",typeof(int));
dt.Columns.Add(dc1);
DataColumn dc2=new DataColumn("col2",typeof(int));
dt.Columns.Add(dc2);
//DataRow dr1=new DataRow();
DataRow dr1 = dt.NewRow();
dr1("col1")=1;
dr1("col2")=2;
dt.Rows.Add(dr1);
SqlDataAdapter adp2 = new SqlDataAdapter("select * from tblcheck", con);
adp2.Fill(ds, "tblcheck");
GridView1.DataSource = ds;
GridView1.DataBind();
}
error is
"dr1 is a variable but is used like a method."
tel me how to handle it?
Chohan
|
|
|
|
|
chohanpk wrote: dr1("col1")=1;
dr1("col2")=2;
Needs to be:
dr1["col1"]=1;
dr1["col2"]=2;
Jon Sagara
I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So i had to leave the place as soon as possible.
--Mr.Prakash
Blog | Site | Articles
|
|
|
|
|
after doing this correction ,now when executing error comes
"Invalid object name 'tblcheck'. "
on
adp2.Fill(ds, "tblcheck");
Chohan
|
|
|
|
|
it's so clear that no table 'tblcheck' in your connection object...
<< >>
|
|
|
|
|
yes alredy no table exist i nnorthwind with this name.
but with this command i m creating new table n also create columns n rows and add data in it.
DataTable dt = new DataTable("tblcheck");
DataColumn dc1=new DataColumn("col1",typeof(int));
dt.Columns.Add(dc1);
DataColumn dc2=new DataColumn("col2",typeof(int));
dt.Columns.Add(dc2);
DataRow dr1 = dt.NewRow();
dr1["col1"]=1;
dr1["col2"]=2;
dt.Rows.Add(dr1);
SqlDataAdapter adp2 = new SqlDataAdapter("select * from tblcheck", con);
adp2.Fill(ds, "tblcheck");
GridView1.DataSource = ds;
GridView1.DataBind();
Chohan
|
|
|
|
|
yes..you create a datatable dt...but that does not mean it will be created in your DB...that's why...you know?
<< >>
|
|
|
|
|
chohanpk wrote: SqlDataAdapter adp2 = new SqlDataAdapter("select * from tblcheck", con);
adp2.Fill(ds, "tblcheck");
GridView1.DataSource = ds;
GridView1.DataBind();
This is looking for a table in your database, creating one in local memory, with nothing in it, is not going to do anything. Even if you were examining the table you created ( in memory, not in you DB ), it would still be empty.
What are you hoping to achieve here ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
here is code:
DataTable dt = new DataTable("tblcheck");
DataColumn dc1 = new DataColumn("col1", typeof(int));
dt.Columns.Add(dc1);
DataColumn dc2 = new DataColumn("col2", typeof(int));
dt.Columns.Add(dc2);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
DataRow dr1 = dt.NewRow();
dr1["col1"] = 1;
dr1["col2"] = 2;
dt.Rows.Add(dr1);
//SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con);
//adp2.Fill(ds, "dt");
GridView1.DataSource = ds;
GridView1.DataBind();
if i dont nclude these rows,
"SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con);
adp2.Fill(ds, "dt");"
then it shows values.
but with these dataadapter code it gives error.i want to use dataadpater to fill the dataset.what will be the solution?
Chohan
|
|
|
|
|
chohanpk wrote: .i want to use dataadpater to fill the dataset
OK, then you need to point the dataadapter to a table that exists
chohanpk wrote: select col1 from dt
OK, that plain won't work. In your SQL, you're pointing to objects in your database, not local variables.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
tel me how can i do this? wht ll be the code?
Chohan
|
|
|
|