|
codeproject_Tarun wrote: Sr. Software Engineer.
Senior software engineers never ask such a vague question. At first they will try to research for possible solutions. If they have any problem on a specific area while implementing, they will came here for help. So do what exactly like a senior software engineer.
|
|
|
|
|
Hai friends
I want to run word application from my aspx page. The scenario is given below.
When I click a command button from aspx page, It opens word application, I will type the contents and on clicking the save button, it gets saved in to predefined file, and word application should close.
Every thing works except closing of word application.
The event available is "DocumentBeforeSave" and I put all the code to save it to a predefined file in this event.
So my question is that, is there any event which works after save ( for closing word application )
Thanks
Shivanandan C V
|
|
|
|
|
I have two textoxes in my form as Password and Retype Password. There is a postback after this,.
The issue is whenever there is a postback, the two textboxes loses value. Is there anyway I can preserve the value and show the same after postback?
please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Why are doing postback aftar Retype Password? because I think its not possible when your textbox mode is set to password.
|
|
|
|
|
It is possible. Probably it would be help somebody. You can use like this:
PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text.Trim());
I got this when I googled for some time and got from forums.asp.net
This will preserve the value even after postback. But I am not sure whether this will invalidate any other action or causes any issue.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Thanks for sharing it.Please also share any issue you find.
|
|
|
|
|
There is a good reason why the password doesn't get sent back in the postback so I would be wary of setting the value manually. Basically, sending the password back in the postback is a security right, if you right click on your page and view source you can see the password value in plain text, this is obviously not a good thing. If that doesn't bother you, or your organisation, fair enough but personally I wouldn't want my password being sent back in plain text.
|
|
|
|
|
I completely agree with you. This is because I didn't implement the functionality initially. But client requires the same and doesn't want to type again and again since the page have a couple of postbacks.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Can't u give something Like "remember me " option ???
and store pwd and username in a cookie ??
|
|
|
|
|
i use UpdatePanel. It work perfectly.
ma tju
Software Application Engineer
Petaling Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Petaling Jaya MOP (Otai)
|
|
|
|
|
I 'm trying to add some free web services to my asp.net website.I'm getting Error......System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
What do i need to do access free webservices.....Can any one provide me some sample code .
|
|
|
|
|
|
I tried it on google..I know i have to pass proxy server credential but dont know how to pass..If u know then plz tell me..
|
|
|
|
|
|
hiiii
dear its still not workin.
i just want to multiply the two textbox values n show this value
in third textbox during runtime.can u solve the problem.....
thnks...
|
|
|
|
|
Are you writing the code in some button click event or in textbox change event.....
|
|
|
|
|
Don't open new threads,continue writting in your previous which you created.
Check this link[^]
I suggest you to buy programming book and to read it.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
m doin this in a function n then calling this function on button click event....
|
|
|
|
|
function or method.... Because this is a simple and working code which is sent by our experts.... it sounds odd when it is not working for you.... kindly send your function and where you are calling that fucntion.....
|
|
|
|
|
ok this is the full code:
private void InsertInfo()
{
SqlConnection conn = new SqlConnection(GetConnectionString());
string sql = "INSERT INTO PurchaseProduct(ProductCategoryId,ProductID,ProductName,BrandName,Price,Quantity,TotalPrice)values(@Val1,@Val2,@Val3,@Val4,@Val5,@Val6,@Val7)";
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@Val1",Txtcatid.Text);
cmd.Parameters.AddWithValue("@Val2",Txtproductid.Text);
cmd.Parameters.AddWithValue("@Val3",Txtproductname.Text);
cmd.Parameters.AddWithValue("@Val4",Txtbrandname.Text);
cmd.Parameters.AddWithValue("@Val5",Txtproductprice.Text);
cmd.Parameters.AddWithValue("@Val6",Txtproductquantity.Text);
int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);// (Convert.ToInt32(Txtproductprice.Text) * Convert.ToInt32(Txtproductquantity.Text));
string total = Convert.ToString(Total);
Txttotalprice.Text = Total.ToString();
cmd.Parameters.AddWithValue("@Val7",Total);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "Insert Error:";
msg += ex.Message;
throw new Exception(msg);
}
finally
{
conn.Close();
Txtcatid.Text = "";
Txtproductid.Text = "";
Txtproductname.Text = "";
Txtbrandname.Text = "";
Txtproductprice.Text = "";
Txtproductquantity.Text = "";
Txttotalprice.Text = "";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
InsertInfo();
}
|
|
|
|
|
My money is on either Txtproductprice or Txtproductquantity not containing a valid integer.
|
|
|
|
|
pariofshona wrote: ...TotalPrice)values...
Should be like this ...TotalPrice) values...
pariofshona wrote: int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);// (Convert.ToInt32(Txtproductprice.Text) * Convert.ToInt32(Txtproductquantity.Text));
string total = Convert.ToString(Total);
Txttotalprice.Text = Total.ToString();
cmd.Parameters.AddWithValue("@Val7",Total);
replace with
int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);
string total = Convert.ToString(Total);
Txttotalprice.Text = total ;
cmd.Parameters.AddWithValue("@Val7",total);
I Love T-SQL www.aktualiteti.com
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
i dono who voted the above answer to remove.... But who ever it might be the answer is,
pariofshona wrote: private void InsertInfo()
this is method not a function
pariofshona wrote: int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);// (Convert.ToInt32(Txtproductprice.Text) * Convert.ToInt32(Txtproductquantity.Text));
string total = Convert.ToString(Total);
Txttotalprice.Text = Total.ToString();
you can directly assign,
int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);
Txttotalprice.Text = Total.ToString();
|
|
|
|
|
Someone voted as Bad Answer to mine answers too
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
ya, this is one of the bad thing to hide thier names and vote.....if they are ready to prove that the answer is bad they can give the correct answer and prove their talents in front of our experts.....
|
|
|
|