|
needhi_p wrote: I want to give functionality of downloading a file
Just redirect to the file which you would like your users to download. Say you have a file in files directory. To download it, Response.Redirect("files/yourfilename.extension")
needhi_p wrote: SaveFileDialog DialogSave = new SaveFileDialog();
if (DialogSave.ShowDialog() == DialogResult.OK)
{
}
else
{
}
You are lost completly. Take some good books on ASP.NET and learn how it works. SaveFileDialog is commonly used in stand-alone applications not in ASP.NET.
|
|
|
|
|
If you do this, you're trying to display the save file dialog on the server, not the client. Not going to work.
If you send a file to a web browser, it will automatically try to give you the option to save it if it's not a recognised html file.
|
|
|
|
|
thnx everyone for helping.. have solved it
|
|
|
|
|
Hi I want a server side event(e.g aspButton1.Click) to be called from a javascript.How can I do this?
ARINDAM
|
|
|
|
|
You can do with AJAX.Please try Google
Cheers!!
Brij
|
|
|
|
|
|
Try this
Javascript :
__doPostBack('RAISE_Your_Event','specify_argument_here_if_needed');
ASPX.CS Page_Load Event:
if (this.IsPostBack)
{
this.GetPostBackEventReference(this, string.Empty);
string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"];
if (eventTarget == "RAISE_Your_Event")
{
string argumentValue = (this.Request["__EVENTARGUMENT"] == null) ? string.Empty : this.Request["__EVENTARGUMENT"];
}
}
"Change is permanent, somethings never change!"
|
|
|
|
|
Hello everyone,
I am using loadcontrol method to load custom controls.
I have a single .aspx page and a left menu (.ascx control) which is loaded dynamically.
When i click on the left menu's link, control is loaded accordingly.
The problem is:
Loadcontrol always loads control with ispostback=true.
It happens bcoz i have used __doPostBack() onclick of the leftmenu's link.
I want the ispostback = false in the control's load event.
Any help is always welcome.
Thanks,
Malay Khandhediya.
|
|
|
|
|
hello friends
I have few tabs (ajax) in my page and in each tab a grid
i am providing delete facility to the user
for this my commands work fine with tab 1
but for the other one its throwing error
command : delete from [allergies] where [drugid]= @drugid
Error : must declare scalar variable @drugid
What i Did : Declared datakeynames = "drugid"
drugid is column name as well as primary key
Please tell me where i did mistake
thanks and regards
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
modified on Friday, August 22, 2008 4:21 AM
|
|
|
|
|
I have two Dropdownlists inside a GridView within the EditItemTemplate. I would like to know how to catch the event of the SelectedIndexChanged. I'm trying to Populate the second DropdownLists when the first one has been selected. Problem is the SelectedIndexChanged Event is not being called inside the EditItemTemplate.
Any Ideas would be greatfull.
|
|
|
|
|
Hi all
I have nested gridview like this
---------------------
| a | b | <-- Header of parent gridview
---------------------
| . |---------------|
| | x | y | z | <-- Header of child gridview
| |---------------|
| | | | |
| |---------------|
---------------------
I want to create Header Like this
---------------------
| a | b | <-- Header of parent gridview +
| |---------------| Header of child gridview
| | x | y | z |
---------------------
| |---------------|
| | | | |
| |---------------|
--------------------- Is if possible?
thank for help
|
|
|
|
|
Try using the Header Template for the headers where you can customize the view of the headers.
Or if you have the data come from different data source and one is depenedent on the other try using a repeater for the main data then a grid view for each repeated item. But I am not sure this is your case.
Sincerely Samer Abu Rabie
|
|
|
|
|
need regular expression for alphanumeric string having space, if any one can help
|
|
|
|
|
|
Why the apostrophes? An alphanumeric string should not contains apostrophes, should it?
[\da-zA-Z ]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
well I saw that one my self on asp .net forums. But you're right!
Thanks for the correction!
|
|
|
|
|
Hey.........
I using code below, but it not display image
MemoryStream mstream = new MemoryStream();
SqlCommand cmdImg = new SqlCommand("SELECT Image FROM TAB_Employee WHERE EmpID='" + EmpID + "'", gCnn);
byte[] image = (byte[])cmdImg.ExecuteScalar();
mstream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(mstream);
// Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, ImageFormat.Gif);
it display as binary
Socheat
|
|
|
|
|
You could try something like this:
string query = "SELECT Image FROM TAB_Employee WHERE EmpID='" + EmpID + "'";
SqlCommand cmdImg = new SqlCommand(query, gCnn);
byte[] image = (byte[])cmdImg.ExecuteScalar();
MemoryStream mstream = new MemoryStream(image);
Bitmap bitmap = new Bitmap(System.Drawing.Image.FromStream(mstream));
Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
bitmap.Dispose();
Best of luck
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Dear,
I tried to use like what you wrote already, but my out put still the same
why?
Can u help me again?
Socheat
|
|
|
|
|
Ok what i think you need to do is:
Place the connection code in a new WebForm and then on the page that your showing your image set the image ImageUrl property to the new webform.
E.g.
Image.aspx is the new webform
Image.aspx contains the new code listed in the post above.
WebForm1.aspx is the page with your image
Set the ImageUrl property to the new webform.
Image.ImageUrl = "Image.aspx";
When the ImageUrl try to load it will load the new Image.aspx page.
Since you are changing the ContentType it should load the page as an Image.
Let me know if this works for you, if not i'm sure there are a ton of different ways to make this work for you.
Best of luck!!!
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Dear,
I tried to use like you said
Image.ImageUrl ="Image.aspx";
It does not show anyanything.
Does Image.ImageUrl="Image.aspx", ImageUrl can get url?
Socheat
|
|
|
|
|
Dear,
Thank you, it work now.............
Socheat
|
|
|
|
|
Glad to hear it
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Hi,
I have ReportViewer Control in Asp.Net page that access one SSRS report from report server "XXX".
I configured report path and report url and its working fine in local machine.
But its giving Access Denied Error when we try to access the page from other machines as follows:
"The request failed with HTTP status 401: Access Denied."
Scenario:
We deployed the ASP.Net application in machine "A", accessing the application from machine "B". And the SSRS report is deployed in Report server machine "C". When we open the application in machine A itself all are working fine.
But when we access the application from machine "B", We are able to access the application except the report in the application.
Any ideas to get rid of this error?
Thanks in Advance
Shahtech
|
|
|
|
|
You might need to look at Kerberos delegation - you are authenticating yourself with the machine at A, but it needs to be able to bounce your authentication on to the machine at C. If you look at the logs on C, you'll probably find access denied for the network user.
|
|
|
|