I have a .Net 4 web application which has a folder called "docs" which is full of Word docs on the root of the website. The words docs are linked with a gridview in my "admin" section
I only want Autheicated users to be able to renders the word docs in the doc folder. I am finding if the user logs out and they manually type in the url to the Word document it renders the file eg.
www.mydomain.com/docs/something.doc
i have tried putting this in my web.config but did not work for the Word docs. It stops the rendering of .aspx files but not .doc's
Is this because the .doc extension is not hadled by the .Net framework and that I need to do something to Handler Mapping in IIS7? I would prefer to put all my security setting in the web.config ideally
I am trying to use the _doPostBack method to retreive data from another URL and return it back to the firstThe url I use is caborealestatejoni.info, I am retreiveing the new information from caborealestateonline and want to past it back into cabrealestatejoni.info...any ideas? I am new to aspx, this is the code that works if I only use the latter url and this works, but how do I use it with a new url?
using gridview delete button with datasource markup: source Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:direct_deliveryConnectionString %>" SelectCommand="select pk_ddlvryDetailID,fk_grfdetailID,itemDescription,qty,uom,rate,(qty*rate) as Amount from qddlvrydetails where fk_ddlvryMasterID=@id" DeleteCommand="delete from tblddlvrydetails where pk_ddlvrydetailid=@id"> [code]... I created a parameter named @ID which will received value from grid selectedvalue whenever the delete button fire up but whenever i do that the will just postback without delete the row.
I'm using ASP.NET MVC to try to postback after confirmation using javascript, this is the button:
<input type="submit" id ="RemoveStatus" value="Remove Status" name="button" onclick="return CheckRemove();"/>
This is my javascript in my CheckRemove() js function:
var button1 = document.getElementById("RemoveStatus"); if (confirm("Are you sure you want to remove status?") == true) { button1.disabled = true; button1.value = "Removing status..."; __doPostBack('RemoveStatus', ''); return true; } else { return false; }
But for some reason I get an object expected error at the __doPostBack bit, I've clearly set the id, button1 gets populated too in debug, i'v tried passing button1.id and button1 too into the __doPostBack call but it wont postback and keeps saying object expected.
In my view I have 2 submit buttons "Submit" and "Save". When Submit is pressed, I have all the data validated. When Save is pressed, I want the data to be submitted without being validated. How can I do this?
i just like to ask if you have any idea of preventing the Back button of the browser to navigate back to the previous page after a user log in.Ex:After a user successfully logged in to my website and he/she hit the Back button of the browser.I want this to not redirected to the previous page instead redirected to the same page which is my Main page.Also after a user logged out to my website and again he/she hit the Back button of the browser.I also want this to not redirected to the previous page instead redirected to my login page.
I have a page with formview, the page contains a lot of input fields and a lot of validators and when I press "Save" button (in which I perform insert procedure) the form is validated, but button click event and page load happens. Validators and button belong to the same validation group. How to avoid button click and page load events happening when some validators aren't correct? In page without formview everything works ok, I click "Save" button and when all validators are correct only then happens button click event. How to fix that with form view?
I am working on Asp.Net application.I wrote the below JavaScript code to prevent the user to not going to login page on click of browser back button when he logs into the application.It is working fine for me,but from the homepage when i click on browser back button,the flickering appears due to post back.How to prevent the flickering.
I'm working an existing .net 2.0 app that someone else wrote. At one point they have a popup window that's opened via some javascript. There are some radio buttons on that popup and a submit button.he submit button on the popup calls another javascript function which assigns values to some javascript variables and then does the following:
I am trying to implement Login/Logout functionality in my website without using inbuilt functionality of Login controls in ASP.NET. In some pages, which require the user to be logged in, I have written this in Page_Load
if (Session["cod"] == null && Session["admin"] == null) { Response.Redirect("You need to Login.aspx"); } if (Session["cod"] != null || Session["admin"] != null) { LinkButton1.Text = "Logout"; } if (Page.IsPostBack == false) { log_bind(); grid1_bind(); grid2_bind(); }
But while I was testing this, I noticed that when I press the Back/Forward button on the browser, these pages are viewable without being logged in. How do I prevent this?
There is a Gridview(say with 5 rows) in my web page with Delete button inside it.
I want that when I delete any row( say I deleted 5, 2, 3, 1) and then when I try to delete the last remaining row i.e., 4 then it should not get deleted.I want that remaining any last row(can be any) in Grid should not get delete.How to achieve that?
I am running one application where one gridview is there when i am deleting any data there it shows one message for deleting.
for message i used this code:
ClientScript.RegisterStartupScript(this.GetType(), "ShowMessage", string.Format("<script type='text/javascript'>alert('{0}')</script>", "this row is deleted"));
after that i am going to some other page ,after going other page when i click on back button in browser it is coming in the previous page but the message which poped up before again getting popup.
i want when user click on submit button then a div layer will be generated over the textbox whose height and width will be just the same as textbox and in this way textbox will be blocked for entering something. i want to do it by javascript. in this scenario other textbox will not be blocked.
I have a page register.aspx that a user can use to register on my website. Once the registration process is completed, I redirect the user to thankyou.aspx where he will get a code to activate his account.
My problem is this: from the thankyou.aspx page, if the user click the "previous button" on the navigator, he can still have access to the information he had previously submitted and might cause data duplication . I don't want this to happen. I want in that case to redirect him back to thankyou.aspx or another page which will be different than the register.aspx.
My questions are:
1. how can I prevent the user to use the "previous button" on the navigator to avoid data duplication? 2. in case question 1 cannot be done, how can I know in register.aspx that the user comes from thankyou.aspx (which should not normally happen) so that I can redirect him to another page?
My approch was before redirecting to thankyou.aspx, I concatenated session.sessionID and another data to be retrieved on thankyou page. And on thankyou.aspx, I destroy the session after the page was loaded by using Session.Contents.RemoveAll(). And here, nothing happens. The session is still on when using the previous button.
I have a simple vb.net page. The first control on the page is a dropdownlist that the user selects from. The second is a text box with a search button. When search is clicked, a third control (another dropdownbox) is populated. BUT, whenever that search button is clicked, the first dropdownbox seems to refresh, and I loose the selection that the user made.
When I click Logout page redirect to Login page but when click to browser arrow back then it will goes back, I want to after Logout cannot going to back page...
I have a report that is created using Telerik Reporing 2010.You have the ability to export to PDF.One of the cells contains a standard hyperlink that when viewed from the report view works fine The cell contains this simple link<a href="http://site.com">link</a>What I would like to be able to do is maintain the hyperlink functionality when the report is rendered to PDF.Im assuming PDF requires something more than just HTML to render a link ?
If I use html.beginform on my partial view, the attributes get rendered. If I remove html.beginform and instead use jQuery to load my partial view into a dialog, the validation attributes aren't firing even after I've called $.validator.unobtrusive.parse(selector) because the attributes are not getting added to the html. Im using Html.EditorFor, and the attributes don't show up unless I put an Html.BeginForm around it.How can I force the attributes (they are [Required] on my model)?