|
If you want to set Session variable while clicking link you can do by Session["Key"]=value in the click event.
Can u plz clarify your question so that we can help you?
|
|
|
|
|
Wow, wish I had thought of that
only two letters away from being an asset
|
|
|
|
|
Hi ,
I store the image in a binary format into THE DATA BASE and while retriving i select byte array from data base noe i am using http handler to display image by giving
image1.imageurl = "ImageHttpHandler.ashx"
how to draw image here again .
Thanks and regards,
Amit Patel
|
|
|
|
|
Amit Patel1985 wrote: image1.imageurl = "ImageHttpHandler.ashx"
What you need, is to point the imageurl to a page which takes an id on the URL, and reads the image associated with that id and returns it instead of a page. Pointing to an ashx isn't going to do anything.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
how can i use edit update function in detailsview as i use in grid view.plz help me out ......thanks in Advance...........
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
public partial class Update_Finance_Details_After_Bill : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
private void BindData()
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("SELECT SL_NO,GRC_No, Name_of_person, Name_Or_Number_Of_Rooms_Occupied , Date, Time, Check_In_No,Sale_Voucher_No,Party_Debit_Voucher_No FROM LHPL", con);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindData();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindData();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
if (((LinkButton)GridView1.Rows[0].Cells[0].Controls[0]).Text == "Insert")
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "INSERT INTO LHPL(Party_Debit_Voucher_No) VALUES(@Party_Debit_Voucher_No)";
cmd.Parameters.Add("@Party_Debit_Voucher_No", SqlDbType.VarChar).Value = ((TextBox)GridView1.Rows[0].Cells[2].Controls[0]).Text;
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
else
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "UPDATE LHPL SET Party_Debit_Voucher_No=@Party_Debit_Voucher_No WHERE SL_NO=@SL_NO";
cmd.Parameters.Add("@Party_Debit_Voucher_No", SqlDbType.VarChar).Value = ((TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0]).Text;
cmd.Parameters.Add("@SL_NO", SqlDbType.Int).Value = Convert.ToInt32(GridView1.Rows[e.RowIndex].Cells[1].Text);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
GridView1.EditIndex = -1;
BindData();
}
protected void btnAdd_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("SELECT SL_NO,Sale_Voucher_No,GRC_No ,Party_Debit_Voucher_NoFROM LHPL", con);
DataTable dt = new DataTable();
da.Fill(dt);
// Here we'll add a blank row to the returned DataTable
DataRow dr = dt.NewRow();
dt.Rows.InsertAt(dr, 0);
//Creating the first row of GridView to be Editable
GridView1.EditIndex = 0;
GridView1.DataSource = dt;
GridView1.DataBind();
//Changing the Text for Inserting a New Record
((LinkButton)GridView1.Rows[0].Cells[0].Controls[0]).Text = "Insert";
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "DELETE FROM LHPL WHERE SL_NO=@SL_NO";
cmd.Parameters.Add("@SL_NO", SqlDbType.Int).Value = Convert.ToInt32(GridView1.Rows[e.RowIndex].Cells[1].Text);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
BindData();
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
}
protected void Button3_Click(object sender, EventArgs e)
{
}
protected void Button4_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=software;Initial Catalog=LHPL_INFO;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("SELECT SL_NO,GRC_No, Name_of_person, Name_Or_Number_Of_Rooms_Occupied , Date, Time, Check_In_No ,Sale_Voucher_No ,Party_Debit_Voucher_No FROM LHPL where GRC_No ='" + TextBox1.Text + "'", con);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button2_Click1(object sender, EventArgs e)
{
}
}
|
|
|
|
|
Hi all,
my website has a search function that search youtube videos for the user.its works well in local machine.when i click the button for search after hosting my site, it leads to a security exception
can anybody help me in solving the same
Thanks in Advance
|
|
|
|
|
Hi,
do you get an error message? Or just the security exception?
Regards
Sebastian
|
|
|
|
|
hello every body
iwant to implement acentral web site using asp.net
and other website as client
the central web stores information about the other website in its database
and the client asks central for information about other clients
ineed ajax also to see direct changes in information
if you can help me
i dont know how to communicate betwwn them and if uou can give me a helpful example im learning asp.net nowdays and iwill be thankful if uou help me with the code
|
|
|
|
|
marwa_noor wrote: im learning asp.net nowday
What you want to do is insanely complex if you're a beginner.
You don't need AJAX, that's mad. You probably want to write some webservices that the two sites can consume to talk to each other.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
All our application are developed using en-us culture.
Now I have to provide the multi-language support to our application.
Issue is all the data in out application is displayed from database and it changes frequently, so i cannot use resource files for this.
Can you help me implementing the globalization using database.
|
|
|
|
|
I think this needs a converter that can convert the existing language to another language.
You can use Google translate to do this job, or any other service...
|
|
|
|
|
Thanks for the reply.
Converting from one language to another is not the Issue.
I want to save/retrieve all the data from SQL Server 2005.
Want to know the best technique to implement globalization using Database, not resource files.
|
|
|
|
|
Aman Bhullar wrote: Want to know the best technique to implement globalization using Database
Here you go
Globalization using SQL Server[^]
Note : You need userid and password for read this article.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks a lot for you reply. I read the article and it's quite useful.
To implemet the Multi-Language support, i have to use the Collation.
My Question is should i use Column Collation or Table collation
|
|
|
|
|
Depends on your requirement. I have already done a project on this. I think if the data type of the character column is NVARCHAR , you dont need to bother about collation. NVARCHAR stores almost all types of data with basic Collation. I have even tested Chinese scripts and it stored it clearly.
Just do according to your requirement. SQL server NVARCHAR is enough in most of the cases.
|
|
|
|
|
|
Dear all,
i have to send a url with some parameters to a another website through my web app. How can i avoid the '&
' and ';' in my url(because the other app gives a error with &
and is out of my control).
i tryid : Server.DecodeUrl en Server.EncodeUrl, bud it does not work.
Im using
Response.Redirect(url)
to pass the url. In my side looks the url something like this:
https://pay.bank.nl/internetbank/SesamLoginServlet?sessie=id&trid=002&rand=2180fe5a3ff1c3b5
So no &
. Bud on the other side you will see &
instead of &
How can i avoid this?
Thanks
modified on Thursday, September 3, 2009 4:24 AM
|
|
|
|
|
Hi,
don't know if I get you right. How does the url look like when you put it into Response.Redirect? Does it have & within?
Regards
Sebastian
|
|
|
|
|
Hi Sebastian,
In my side it has only &. bud ofter redirect, on the other side it has & and that's not good, they accept only &
|
|
|
|
|
That is because the & are encoded. Did you use any UrlEncode before?
|
|
|
|
|
Yes i did and also checked, it had no & . bud ofter passing it to the other page, you will see &
|
|
|
|
|
Okay, then could you post your code? First I would try to out just the string in the Response.Redirect (hardcoded). If this works then the problem is when you create the string. If not, the problem is REsponse.Redirect.
But let us take a look at your code.
|
|
|
|
|
Hi Semartens,
Thanks for replay.
Here is my code:
string url = issuerAuthenticationURL.Text;
string url2 = Server.UrlDecode(url);
Response.Redirect(url2);
When copy and paste the url2, it works fine, bud if i do Response.Redirect(url2) then it goes wrong.
|
|
|
|
|
1. Why do you Decode the Url? Don't you have to encode?
2. What if you just pass url, not url2?
3. Does your Url contains & or just & ?
|
|
|
|
|
Thanks SerMartens and others, the issue is solved by using the
Server.HtmlDecode instead of urldecode
|
|
|
|