|
Is there an asp.net file download option that ONLY saves to the users harddrive & does not provide them with any option to immediately "Open" the file in their browser?
Our users have the option to download several files from our website so when they click "Download", they're presented with the typical File Download popup window that contains both "Open" & "Save" buttons.
There's one report in our system however that crashes whenever the user selects "Open". If they select "Save" to save it to their desktop, then it works fine however. So I want to eliminate the ability for them to "Open" this file in their browser and instead, just give them the ability to "Save" it to their harddrive.
How can I do this?
Thanks.
-Goalie35
|
|
|
|
|
You may try with the the DownloadOptions <META> tag:
<META name="DownloadOptions" content="noopen">
More information from here[^].
|
|
|
|
|
Thanks minhpc_bk.
That worked.
-Goalie35
|
|
|
|
|
Hi all,
I have some small divs which onmouseover generate a bigger div to display data inside , but i am unable to call a function in code behind.Here is what i did...
1.Made the div as server control.
2.In code i wrote..
Div1.Attributes.Add("onmouseover","Showbigdiv();")
3.public void Showbigdiv() is where i display bigger div.
But its giving an "Object expected" error.
I am a newbie,please help!!!
Thanks in advance....
-- modified at 10:47 Monday 22nd January, 2007
|
|
|
|
|
It's happening because the js and the codebehind only ever exist together when you're developing...normally, the codebehind exists on the server, the javascript in the browser. So when the browser encounters your mouseover attrib, it looks for Showbigdiv somewhere on your page. Since it's not there, (it's on the server) it can't find it, so Expects an object.
There are a couple of ways to get around this - you could make an out of band call to the server to get the data that you need, or if a postback isn't a problem, I tend to put a nmormal asp:button on the page, with its OnClick handler pointing to Showbigdiv, and visible set to false. Then in the page, define a javascript function similar to:
<br />
function handleMouseOver(()<br />
{<br />
document.getElementById (myAspButtonClientId).click();<br />
}<br />
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
Is there a way where I can set a button to validate ONLY 1 control? Instead of the whole page? I dont mean validation controls.. I mean "Causes Validation"
Thanks.
|
|
|
|
|
Dear All,
I created a web application using vs2005 and this is my problem
I want to control access per page and per user basis, futhermore i will do on groups basis later
What i want to do is to create a webfrom for the admin that lists all the webforms of the web application in a checkbox list or a lisbox control.
So after the admin picks a user he sets the "Allow/Deny" the user access to the page by checking or unchecking the items. I will later save to the database.
I installed the aspnet db to create and manage the users and for security but it only gives permissions per folder not per page so is there a way to exploit it?
So what i need is to know how to list the pages and how to manager security
Any keys would be apriciated
Thanx in advance
Best Regards
3ala2
|
|
|
|
|
You can do it in the following way:
You have a User Table: (UserID, Username, UserGroupID)
You have a UserGroup Table: (UserGroupID, UserGroup Description)
You have a Permissions Table: (PermissionID,Description)
You have a Link Table between the Permissions and the UserGroup: (UserGroupPermissionID, PermissionID, UserGroupID)
Lets say you have only 2 user groups: General User and Admin.
A user can be SET to be any of the 2 UserGroups.
Lets say you have 2 Webforms. Webform1 is for General Users and Webform2 is for Admin. Consider each webform like a seperate permission. So lets say Webform1 is PermissionID 1 and Webform2 is PermissionID2:
Permission Table:
=================
Permission ID ... Description
1 ... Webform1
2 ... Webform2
UserGroup Table:
================
UserGroupID ... Description
1 ... General User
2 ... Admin
UserGroupPermission Table:
==========================
UserGroupPermissionID ... UserGroupID ... PermissionID
1 ... 1 ... 1
2 ... 2 ... 1
3 ... 2 ... 2
So you can see from that table that General User is allowed permission 1, whereas Admin is allowed permission 1 AND 2.
After you set the figures in the database, At the top of Webform1 code-behind page, you will need to query the database by passing the session UserID. Use a VIEW of the Permission link table and the usertable. If the UserID has permission "1", then allow him to see Webform1. If he doesn't, then redirect him/her.
Do the same for Webform2. If the user doesn't have Permission "2" in the database, he will simply be redirected away.
HOPE THIS HELPS!
|
|
|
|
|
Thanx mate
what about listing teh webforms issue
how can i solve that?
Best Regards
3ala2
|
|
|
|
|
It is a very straighforward but very very long problem to describe. Please, rephrase your question to make it more precise.
|
|
|
|
|
i just want to list all the webforms names in my project "the aspx only" in checkboxlist or a listbox control. i want the dispalyed text is the webform name and the value is the full path for it
i guess i can do the rest of security issues
how can i do that?
Best Regards
3ala2
|
|
|
|
|
I'll explain what I did:
In addition to the above post, I had a webform which had a datagrid that displayed ALL the records for the different permissions which I have defined(recall Permission Table). Remember that EACH Permission represents a Webform, so there is no need to list the page. You can make the Datagrid entries hyperlinks to the weforms if you like.
You can add/edit/delete all the Permissions which you have on that particular webform, just like you can add/edit/delete user records and such, BUT.. EACH webform, EVEN the Permissions webform, will have hard code which will give different users access/denial.
for instance, lets say that in the Permissions table, you have the following record:
PermissionID = 9
PermissionDescription = Permission Webform
and the Admin User Record is:
UserID = 1
Username = Admin
UserGroup = 2(i.e. Admin)
and the UserGroupPermissions Record(in the LINK table) is:
UserGroupPermissionsID = 3
UserGroupID = 2(Admin)
PermissionID = 9
This means, logically, that the admin is linked to PermissionID number 9.
Now lets go back to the webforms. In the PageLoad even of the Permission Webform(which is what you are asking about), you will HARD CODE the following:
After creating a VIEW of the tables which show a link between Admin and the Appropriate PermissionID for the Current page, you will pass the UserID which should be stored as a Session variable as soon as any user logs in. Pass that ID through a SQL query and check whether the UserID in the Session variable HAS the Permission ID of the link table... IF YES, then Load the page, IF NO, then redirect.
You are asking about the webform itself I think. The Webform itself for this will be the same as any other webform for adding/editing/deleting records. Use a datagrid which should be bound with the information from the appropriate TABLES or VIEWS.
When you create a New Permission, like SiteMap Page Permission, you will HAVE TO HARD CODE the permission authorisation as described above, but this time for the SiteMap page.
I hope this answered your question.
-- modified at 9:24 Tuesday 23rd January, 2007
|
|
|
|
|
Thanx u so much
That was helpful and guess i'll do it this way
But still wondering how i can list the project files dynamically
Thanx again
Best Regards
3ala2
|
|
|
|
|
I have no clue there mate, my system did not need what you are asking for, and I havent explored that option lol..
Anyway, I hope you find your answer.
Take care.
|
|
|
|
|
i have a report shows a chart for user
the chart appear for user in default templet
how can i give the user 2 choose the tamplet for the chart in run time
"give him gallery 2 select"
MD_NADA
|
|
|
|
|
Hi All,
I have create Web Application using C#,ASP.NET and uploaded to our Server.it is working Perfectly when I Browser site using Internet Explorer.
BUT When I used Mozilla FireFox,There are UI Issues like Table Rows Alignmets changes,Text Box Width Changes ,etc....
How do I fixed issues and Compatible for Mozilla FireFox?.
Please help me.
Thanks in advance.
|
|
|
|
|
You've just got to figure them out individually. they are going to be slightly different - Firefox tends to be more standards compliant.
|
|
|
|
|
When pages render differently in Internet Explorer 6 and Firefox, it's almost always Firefox that renders them correctly. It's a common misconception that it is Internet Explorer that is the standard just because it's the most commonly used browser at the moment, while the truth is that there are several bugs in IE 6 that makes it render pages incorrectly.
When it comes to form fields, you will never get them to render exactly the same in different browsers and in different operating systems, as it's not defined in the standard exactly how form fields should be rendered. One method that I have had some success with is setting the width of the field to 100% and putting it inside an element with an absolute width.
---
Year happy = new Year(2007);
|
|
|
|
|
hi, thanks for reply.
I have faced Java Script Problems with FireFox.I need to Row visible and Row Visible false using Java Script.My JavaScript Segment is given below.This is working fine with IE. But this is not wroking correctly with FireFox.
Can you please tell me what is the wrong in there?
var row1 = document.getElementById(controlname);
if(row1!=null)
{
if(i<=datarows)
{
row1.style.display = 'inline';
}
else row1.style.display = 'none';
}
Thanks in advance...
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
Year happy = new Year(2007);
|
|
|
|
|
I want to select some criteria on on page and according to that criteria second page should be displayed.
Means there are some drop down lists on one page in which some columns of database tables are retrieved and based on that on the next page it should show that critera as well as should have provision to add some data so that it will again send back to the database in proper table.
There are five tables with one unique id and the description or name and there is one table having seven fields or column to save its unique id, five ids from the previous database tables and the description field which has to be filled after selecting criteria.
With Regards
Rajkumar C. Tambe.
M.Tech (CAD/CAM)
|
|
|
|
|
You can store information in Session or Cache.
But put there only the required information, in order to save the memory.
For more info, take a look at:
[^]
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Try taking a look at cross page posting if using framework 2 - might help
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi All.
i need the code to download an exe file using asp.net and C#.
and make the option to save and run after the exe file download.
thanks
srinandan.
|
|
|
|
|
WebClient Client = new WebClient ();<br />
Client.DownloadFile("http:\\blabla.com\file.exe", "file.exe");
To run it, use the ProcessStart class :
http://www.csharp-station.com/HowTo/ProcessStart.aspx
|
|
|
|