|
I can not use AJAX.My webpage will run on a mobile browser.I am not sure whether mobile browser supports AJAX or not.
ARINDAM
|
|
|
|
|
then you need to mention it first while posting. Any way, i am not sure about mobile application but i think it should support Ajax.
i am not sure!!
|
|
|
|
|
yes i sould have mentioned it first.anyway thanks for reply Abhijit.
ARINDAM
|
|
|
|
|
Hi...
I am making a website in asp.net using c#. I want to give functionality of downloading a file. For dat i tried using SaveFileDialog in codebehind as under.
SaveFileDialog DialogSave = new SaveFileDialog();
if (DialogSave.ShowDialog() == DialogResult.OK)
{
}
else
{
}
Bt wen comparing if condition, it gives me following error.
"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
Can someone tell me the way to use this SaveFileDialog or some other way to achieve this functionality.
|
|
|
|
|
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
|
|
|
|