|
hi
i am designing a desktop application and a website. i have write the following code in desktop application but facing difficulty to do the same task in website.i am using grid to display data. in desktop application the Event "GridView1_CellClick" exist but in website i dont find it, can anyone tell me what changes to do with the follwing code to apply it in website
searchgrid.CurrentRow.Cells[0].Value;
Image1.Image = Image.FromFile(path);
protected void Page_Load(object sender, EventArgs e)
{
String strConnection;
strConnection = "server=localhost;User ID=sa;Password=sasa;database=rescue15";
SqlConnection conn = new SqlConnection(strConnection);
conn.Open();
string s = " SELECT cr_pic FROM criminal WHERE cr_id = " + searchgrid.CurrentRow.Cells[0].Value;
SqlCommand com1 = new SqlCommand(s, conn);
SqlDataReader dr1 = com1.ExecuteReader();
if (dr1.Read())
{
string path = dr1.GetValue(0).ToString();
Image1.Image = Image.FromFile(path);
}
dr1.Close();
}
}
i am using ASP.Net with C# and SQL Server2005
|
|
|
|
|
mavii wrote: Image1.Image = Image.FromFile(path);
This is a waste of time, it creates an image on the server. Generate an img tag which has a src attribute with the server path ( so not the file path, but the path as a URL that a browser can see )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
actually i want to display the image of person according to his ID in the table, so in table i have saved the url, as i have used grid, when one clicks on the Grid, the ID in the first column of the grid is picked and image URL of that ID is taken from table which is diplayed in the picturebox.and i hv not any clear idea of server path, will u plz explain it?
|
|
|
|
|
If your ASP.NET app can see the file, then it must be within the web application. Sending c:\inetpub\MyApp\images\cgraus.jpg means nothing to the client. \images\cgraus/jpg will work fine, it's a path from the web root.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I was wondering is there a way to create groups in session. so that if I needed to clear down session variables pertaining to a particualr section of our application, I could call Sesswion.Clear on that group, but leave all others intact?
Regards
Paul Custance
|
|
|
|
|
oceanexplorer wrote: is there a way to create groups in session
Upto my knowledge NO.
oceanexplorer wrote: so that if I needed to clear down session variables pertaining to a particualr section of our application, I could call Sesswion.Clear on that group,
You can do this using Arraylist or any other memory storage. So each of your section values are filled into ArrayList and store arraylist object to session. To remove a particular section data, simply do Session.Remove(your section name). So arraylist object contained in the specified location will be removed and others will still exist in the session.
|
|
|
|
|
Thanks for your help, much appreciated. I have decided to implement a Dictionary in order to create groups in session.
Regards
Paul
|
|
|
|
|
I show error messages via pop up windows.
at first there is no striction for blocking pop up windows.
after 3rd debugging, pop up blocker was automaticaly activated.
i deactived that, but i cant still see my pop ups
whyyy ?
|
|
|
|
|
Are you calling popup window in ASPX page or are you writing popup script to response from code behind ?
|
|
|
|
|
i use this code
Response.Write(<script language = ""Javascript"">var win=window.open('Message.aspx',null,'width=510,height=255,top=250,left=250','true');win.moveTo(0,0);</script>)
or
this one
Response.Write(<script language = ""Javascript"">var win=window.open('Message.aspx',null,'width=510,height=255,top=250,left=250','true');win.moveTo(0,0);</script>)<br />
response.redirect ("hi.aspx")
but both of them not run.
|
|
|
|
|
try executng this in your page,, this code will detect the pop blocker status
function detectPopupBlocker() {
var test = window.open(null,"","width=100,height=100");
try {
test.close();
alert("Pop-ups not blocked.");
} catch (e) {
alert("Pop-ups blocked.");
}
}
// Created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(detectPopupBlocker);
winnie
|
|
|
|
|
Hi,
How can I use SSL in my ASP.NET eCommerce application? SSL is already installed in Web Server.
Please help me
Thanks
Regards
Nazeem
-- modified at 9:00 Thursday 23rd August, 2007
Mohamed Nazeem
Software Engineer
Bangalore
|
|
|
|
|
If IIS is set up, you need to just use HTTPS in your URL. Make sure all links away from the secure pages are absolute, otherwise people will keep using HTTPS on your site, which consumes more bandwidth, if nothing else.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi friends
I am working on Internal Search engine App.
I want to Highlight to Search keywords in the resulting text.
Thanks In advance
Pathan
---------------------------------------------------
|
|
|
|
|
You need to use CSS for this, each highlighted word needs to be in a div which is styled to have a different background color.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian for ur reply
i have done it using replace method of string.
Pathan
---------------------------------------------------
|
|
|
|
|
hi all,
there is a java application that uploads, manages and converts docs to other formats
in this application when a conversion is required a .net web service is consumed and completes the conversion process.
Now, for some reasons the web service needs to be changed so we have developed a new webservice using .net 1.1 and c# and workd fine when tested using a .net client.
We have changed the name of the webservice to the new one in the existing application but for some reasons the communication between the application and web service is not happening!
Is there something that we missed? I mean any steps to be followed while developing a webservice which should be used by java client?
Thanks,
gauthee
|
|
|
|
|
Did you change the web service definition (wsdl) at all?
|
|
|
|
|
Paddy,
I have not done any changes to WSDL!
gauthee
|
|
|
|
|
Hi All
I have one aspx page in which i am using one usercontrol 2 times Now the Problem is Even i am making one of 2 usercontrol Visible false then also its Page load event is calling
Can anyone please help me What i want is pretty simple if i don't want usercontrol in my page then its pageload method should not be called, I tried by making that user control visible false in page Oninit method but no use
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Sandeep Akhare wrote: Now the Problem is Even i am making one of 2 usercontrol Visible false then also its Page load event is calling
Yes it will call, because setting visible=false won't stop rendering the control. Try checking the visibility in usercontrols page load. If it is not visible, don't execute your page_load methods...
|
|
|
|
|
The Visible property determines if the control will be rendered or not. You can set the visibility any time before the rendering. When the Load event runs, you don't know what the value of the Visible property will be at the rendering.
If you have any code in the control that should not be run if the control is not rendered, put it in the PreRender event, and check the value of the Visisble property to determine if the code should be run or not.
---
single minded; short sighted; long gone;
|
|
|
|
|
hi all,
i have a website which has lots of images.when a user clicks a image,i need to display to him images downloaded by others which are most commonly recommended. something similar to amazon.com, where if u select a book, people who bought other books are displayed
Customers who bought this book also bought ....
i need to do something similar to this.
i found a very nice article - simple recommender system , here http://www.codeproject.com/aspnet/collabnetwork.asp.
but the values are stored in cookies. If i want to do the same using SQL server 2000, how can i store the datas?
Can anybody help me with some suggestions?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Assume you are storing images details on a table. You have to use one more column to store download counter. When you get downloads for images, increment the counter.
In the product page you can select images according the downloads it got and display as most popular downloads. In this where you are facing problem ?
|
|
|
|
|
hi,
Thanks for your reply. But may be i did not explain clearly my need.
All the images are say inside a category. so for each category i have n number of images.
Say when a user clicks a category,i want to know what are the images he clicked. he may click n number of images and may visit the same image any number of times, but i will display only the top 5 images which are mostly visited.
It should not be based on rating. i need to track what are the images and their links he visited for each category
it should be like this.
For a category Flowers,
he clicks images like rose,then jasmine then lily and so on.he may click rose any number of times.
i need to store them in the table and finally for each category i have to find out the popular flowers.
Hope i made my point clear now.
Sorry for the wrong interpretation.
Thanks in advance.
Regards
Anuradha
|
|
|
|