|
Hi,
Yes, you are correct. My answer wasnt logical at all. Thanks for your reply.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi all
I have a datagrid, which holds item name, item price, and its image(all from SQL Server database), what I need is when the user clicks on the image, I need the (id) for the item to be carried to the new page where I want to show more details about the item (expiry date, ...)
regards
|
|
|
|
|
Hi
You can add an imagebutton in the template column and set its ImageURL to the image you wish to display.
Then, set the imagebutton's CommandName to the itemID and in its Click event, use the commandname as querystring to navigate to another page and display that id's details...
Hope it helps you..
~VSree
|
|
|
|
|
Hi Dear
Ok, but how can I bind it to the datagrid
Regards
|
|
|
|
|
Thanks alot Dear...
It works...
Have a nice day...
|
|
|
|
|
Vsree has said a nice way, we have one more way using html controls. use a anchor tag and inside that use the image tag, set the image src to the image path and href of anchor tag to the redirection path. if you use this way, no need of writting any code to the page.
but you have to use the template column any how.
cheers
asithangae
|
|
|
|
|
Thanks alot
but could you please give me a sample code of that
Regards,,,
|
|
|
|
|
Thanks alot Dear...
It works...
Have a nice day...
|
|
|
|
|
Hi, I am building a web form in which i need to create a temporary table in database when the page loads.I store the intermediate results in the table and delete the table when the browser window is closed.
I tried writing creation and deletion of table using stored procedures in global.asax.cs in Application_Start(Object sender, EventArgs e) and Application_End(Object sender, EventArgs e) but it acts wierd.i.e it some times works and sometimes not.
Pls help me and suggest any other way if any.Thanks in advance.
|
|
|
|
|
You're not going to find a way to delete a table when the browser is closed. Well, you may be able to trigger something with javascript, but I'd look to improve the design. Why do you need to creat temporary tables ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am using the temp table for employee search. Initially i create a temp table,fill it with all employees and then work out on each emp search condition selected by user such as grade,dept and keeping only those tuples which satisfy the condition and delete all other and show the results in a datagrid.At the end when the user logs out or closes the window the table should be deleted. I appreciate ur concern but i can`t change the design.
|
|
|
|
|
OK, the design sounds terrible, good luck with it.
Your best bet is to create a table that stores employees with a key such as the session ID, and deletes them after a timeout, rather than hoping to catch when the browser is closed. This would mean one table, no temp tables, which is at least an improvement.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
http://ashishware.com/AJAXTT.shtml
Source code and some write up on creating AJAX tooltip for ASP.NET DatagridView.
Can be used with DataGrid(asp.net v1.x) with minor modification.
Hope u find it useful
|
|
|
|
|
This is a forum for questions. If you want to submit code, write an article for the site. No-one will ever find this post after tomorrow, when it's buried in questions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am fairly new!
My prob. is this
i have a some listboxes which i populated from a table.
Now in the "submit" button i have written an approproate code to insert the selected items to a table.
but what happens is, irrespective of the value i select, the first item gets inserted into the table ...
here is the code ... plz tell what's stupid in this!
---------------------------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
if (!this.IsPostBack)
{
me = new common();
ds = new DataSet();
conn = new SqlConnection(me.conString);
sda = new SqlDataAdapter("select * from users",conn);
sda.Fill(ds,"users");
projman.DataSource = ds.Tables["users"].DefaultView;
projman.DataTextField = "username";
projman.DataBind();
projman.SelectedIndex = -1;
devlead.DataSource = ds.Tables["users"].DefaultView;
devlead.DataTextField = "username";
devlead.DataBind();
devlead.SelectedIndex = -1;
testlead.DataSource = ds.Tables["users"].DefaultView;
testlead.DataTextField = "username";
testlead.DataBind();
testlead.SelectedIndex = -1;
devteam.DataSource = ds.Tables["users"].DefaultView;
devteam.DataTextField = "username";
devteam.DataBind();
devteam.SelectedIndex = -1;
testfocal.DataSource = ds.Tables["users"].DefaultView;
testfocal.DataTextField = "username";
testfocal.DataBind();
testfocal.SelectedIndex = -1;
sqefocal.DataSource = ds.Tables["users"].DefaultView;
sqefocal.DataTextField = "username";
sqefocal.DataBind();
sqefocal.SelectedIndex = -1;
}
string pgmsg = Request.QueryString.Get("qmsg");
if (!(pgmsg==null))
{
if (pgmsg.Equals("exists"))
{
msg.Text = "The project ID or name exixts already, please enter different value!";
}
}
else
{
msg.Text = "";
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.submit.Click += new System.EventHandler(this.submit_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void submit_Click(object sender, System.EventArgs e)
{
Response.Write("")
string proid;
proid = domain.SelectedValue + "_" + subdomain.SelectedValue + "_" + projname.Text;
bool projExists = me.chkProj(proid);
if (!projExists)
{
projExists = me.chkProj(projname.Text);
}
else
{
Response.Redirect("newproj.aspx?qmsg=exists");
}
if (!projExists)
{
string userid;
string role;
string type;
string cmdText = "insert into " + Global.project + " values ('" + domain.SelectedValue + "','" + subdomain.SelectedValue + "','" + proid + "','" + projname.Text + "')";
conn = new SqlConnection(me.conString);
com = new SqlCommand(cmdText,conn);
com.Connection.Open();
com.ExecuteNonQuery();
com.Connection.Close();
me.attachUser(projman.SelectedItem.Value,proid,Global.projectmanager);
me.attachUser(testlead.SelectedItem.Value,proid,Global.testlead);
me.attachUser(devlead.SelectedItem.Value,proid,Global.devlead);
Response.Write(projman.SelectedItem.Value);
}
else
{
Response.Redirect("newproj.aspx?qmsg=exists");
}
}
}
-venkat
|
|
|
|
|
dravidan wrote: projname.Text + "')";
You're begging for a SQL injection attack here. You should read up on them. A better way to go is to sanitise all strings and use stored procs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That is not the code that you are running. It won't even compile.
Please show the real code. I don't want to look for errors in code that isn't even used.
---
single minded; short sighted; long gone;
|
|
|
|
|
Forget the code for a moment, can you plz tell how to save all the details of a listbox(details such as the currently selected index), say list1, in a place so that when a postback occurs i can reload the listbox list1, with the saved values.
the code compiles properly, but when a post back occurs, an obvoius error pops up, because of the fact that i only populate the listboxes on first load.
i suspect the error must be either in the load event or the click event thats why i posted em.
why do u say that this code wont compile?
plz help me out!
-venkat
|
|
|
|
|
You can only load the data on first load, precisely because if you reload it, you throw away your viewstate info, including the selected item. You get all this info for free, so long as you've not turned off viewstate. If you have, then you won't get it, and you won't have it to save anywhere else, either.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
dravidan wrote: why do u say that this code wont compile?
I presume he copied it into an empty project and attempted to compile it. Either that or he was astute enough to spot a compiler error by looking at the code posted.
|
|
|
|
|
dravidan wrote: Forget the code for a moment, can you plz tell how to save all the details of a listbox(details such as the currently selected index), say list1, in a place so that when a postback occurs i can reload the listbox list1, with the saved values.
Unless you turned off viewstate, the listbox will take care of that itself.
the code compiles properly
Then you should post that code.
dravidan wrote: i suspect the error must be either in the load event or the click event thats why i posted em.
Eh... no, you didn't. At least not the same version as you were using.
dravidan wrote: why do u say that this code wont compile?
Because it won't.
Look at the first line in the submit_Click method. Can you see why that won't compile?
---
single minded; short sighted; long gone;
|
|
|
|
|
please tell me how can i unzip the zip files ...
Feoze
|
|
|
|
|
Please don't cross post.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i set the maxRequestLength property in web.config to recieve files larger than 4 MB but when i upoload online, after some time page timeout messages display.... help me please.....
Feroze
|
|
|
|
|
You already have a thread about this. There is no need to start another thread about the same thing the same day.
---
single minded; short sighted; long gone;
|
|
|
|