|
Take a step back and think about how HTML works.
The browser gets the page from the server. The IMG tag in the page points to where the image data is located. The browser makes a seperate request to get the image.
You will need to implement another page (better still an ashx handler), which can write that byte[] out, and set the Response.ContentType to image/jpeg (whatever).
Also please have a google for "SQL Injection" and "Parameterized Queries", because as your code stands now, I can delete anything out your database by typing nasty things into TextBox1...
|
|
|
|
|
But in my application i am not going to ask user to type the image names and etc , and i am working in vs.net 2.0 with C#.
Actually my problem is i have to display different images in treenode of a treeview for that i have stored the details and the images in the sql and i have retrieved the image too.
But the thing is i am not able to display the images in my webform.
So is there any way to display the images.
VanithaVasu
|
|
|
|
|
iam writting the database connection string in appsettings of a weg.config file like this
< add key="my connection" value="Data Source=abcd;UID=ab1;Password=ab2;"/>
but this should not be visible to the user in the same way how this can be encrypted.
|
|
|
|
|
Hey,
u can try this link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
DataProtectionConfigurationProvider by using this the web.config appsettings are automatically converted to some code ..is this code is genrated same for all applications ....now where i have to write the encryptmethod of web.config and where i have to decript ...when i decript again i have to call encrypt....
|
|
|
|
|
Hey,
check it and implement it.
link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Imports System.Configuration
Imports System.Web.Configuration
sir even thoug iam importing these two namespaces but iam getting the errors
WebConfigurationManager.OpenWebConfiguration not declared error is comming wat the problem in it sir
|
|
|
|
|
Hi,
With the following code I am getting error that
at this line
int.parse(viewstate["0"]) +=1;
error:-
Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
if(!ispostback)
{
viewstate["index"]="0";
}
On Next Button event
if (viewstate["index"].ToString()=="0")
{
//Get question from arraylist with 0 index
int.parse(viewstate["0"]) +=1;
}
else
{
//Get question from arraylist with viewstate index number
string quest=arrlist[int.parse(viewstate["index"])]
//check if question is from last array index then disable next button
if(int.parse(viewstate["index"])==arrlist.count){
//disable next button}else{int.parse(viewstate["0"]) +=1;}
}
On Previous Button event
if (viewstate["index"].ToString()=="0")
{
//Get question from arraylist with 0 index
//disable previous button
int.parse(viewstate["0"]) +=1;
}
else
{
//Get question from arraylist with viewstate index number
string quest=arrlist[int.parse(viewstate["index"])]
int.parse(viewstate["0"]) -=1;
}
|
|
|
|
|
Hello Friends,
I want to get the ID(unique field in "GridView3") respectively i click on the "Select" button or link. Here i'm giving my code. Plz check and make me correct.
protected void GridView3_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
string str = GridView3.SelectedRow.Cells[1].Text;
lblMsg.Text = str.ToString();
OR
lblMsg.Text = GridView3.SelectedRow.RowIndex.ToString();
}
But it throw(s) an error like
Object reference not set to an instance of an object.
|
|
|
|
|
HI Knowledge!
Actually I m not getting what exactly ur problem lies.
Is label inside the Grid or Outside?
do ur Source has the Unique Id that u r use to bind the grid?
And yes About the Error :
This Error Generally Arises when There is Unavailability of a Control.
Believe Yourself™ :->™
|
|
|
|
|
This event doesn't give you any selected row,you have to select row of the gridview as
GridView3.SelectedIndex=e.NewSelectedIndex;
GridView3.datasource=place here datatable
GridView3.databind()
place ur code in the following event. I think your problem will be solved.
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
{
string str = GridView3.SelectedRow.Cells[1].Text;
lblMsg.Text = str.ToString();
OR
lblMsg.Text = GridView3.SelectedRow.RowIndex.ToString();
}
|
|
|
|
|
Hi,
I have not a option for CreateTextFormatOptions of ExportOptions.
I am using Crystal Report 10 version. and I want to export report into Text file.
I want to formatting the text file using
ExportOptions.CreateTextFormatOptions.CharacterPerInch = 16
ExportOptions.CreateTextFormatOptions.LinePerPage = 5
but CreateTextFormatOptions is not a option for ExportOptions.
Is there any solution for this problem.
Thanks,
Arti Khachariya
modified on Saturday, February 9, 2008 3:53 AM
|
|
|
|
|
This forum is for ASP.NET questions.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Genious...
I have developed folder browser which only displays the folders and not files in browser window..and let users selects folder path.
This user class like Win32SDK and inports dlls like shell32 and shared function
<dllimport("shell32.dll", preservesig:="True," charset:="CharSet.Auto)"> _
Public Shared Function SHBrowseForFolder(ByVal bi As BROWSEINFO) As IntPtr
End Function
and opens the browsing window with
idListPtr = Win32SDK.SHBrowseForFolder(bi).
Now one interesting thing is that this works in my application perfectly.. but when i publish this on local .. its not even open browser window and page opening gets hang...
i think it is may be because security of windows's dll problem..
Any solutions..? please...
|
|
|
|
|
rain raj wrote: I have developed folder browser which only displays the folders and not files in browser window..and let users selects folder path.
Why do you want to display a folder browser dialog from a web application? What purpose does it serve?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Paul..
First of all ,Thanks for replying...
Ok.. now i will tell you why it is needs...
I have requirement like User can be able to select folder path from folder browser.. and then after selecting that, some files will copy from to server to user's selected path(Selected folder)
Eg if user selects desktop then user's selected path is like
C:\Documents and Settings\Administrator\Desktop
and next, some files from my server will copies to users desktop.
Is there any other way to get selected folder path from user's local drive then i will always welcome your any sugestions...
Thanks..
|
|
|
|
|
You can't do this. The browser can't access local resources on the client machine for obvious security reasons. Otherwise, websites could do malicious things with your user's file system. You have to adopt a different mindset when working with web applications. Some of the things you take for granted in Windows applications simply are not possible.
The best thing you can do is to provide the facility to download a file or files. You could consider packaging a set of files up into a ZIP archive and then providing the user with the facility to download it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
ok.. I got it..
Thanks for this sugestion.
i will definately apply your sugestions as it is best.
Tarak
|
|
|
|
|
Is your application in asp.net? if yes then why you are not using classes in system.io namespace to browse folders.
|
|
|
|
|
I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin .
Can anyone help me out in this.
THanks
|
|
|
|
|
From where you want to delete file ???
|
|
|
|
|
any folder on c or d drive. anywhere.
|
|
|
|
|
ritu4321 wrote: I need to delete a file which should get completely deleted not even be there in recycle bin .
By default, when a file is deleted using the System.IO methods it won't be moved to the Recycle Bin. You have to write specific code to do that.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
By default it goes to recycle bin . I need to know how to delete it completely without going into recycle bin.
|
|
|
|
|
I think u want something like Permanent delete?
Once u delete a file then it goes to recycle bin and then it also deleted from recycle bin also?
Believe Yourself™ :->™
|
|
|
|