i would like to know if i could create a session base on an hyperlink i do not want to pass param to the page i wanted to create a session base on a hyper link comming from a gridview.
this page would normaly populated when the user logon however i wanted the some oneelse to access this page like the orginal user would except that he would not log on but the page would see the session as if it was the user. click event i am using aspx:hyperl
I built a base controller class inherits from Controller class to add some custom behavior to all controllers which will inherit from this base class.
My issue is when I try to access HTTPContext and Session objects in my custom base class, they are always null.
Am I doing something wrong or need missing something?
My custom base class definition:
public class ApplicationControllerBase : Controller
controllers classes definition:
public class HomeController : ApplicationControllerBase
using ASP.NET MVC 1, .NET 3.5.
UPDATE:
It seems the issue is I try to access HTTPContext in the constructor while HTTPContext is not ready yet, I tried it in the OnActionExecuted event handler and it works fine.
My question is what is the best place to access Session object in my custom controller class, that will guarantee executing my code with all controllers.
How to pass session value through Hyperlink in asp.net in i have the textbox value in 1st page,if am given textbox then click the hyperlink i need the 1st page textbox value
I am new in asp .net.I am not able to undestand why we call base class method when we override methods/events.Like automatically visual studio will put base.OnInit() if you are overriding OnInit.
I have to implement User base security in my Web project using .Net3.5. Followings are some we need:
Roles can be Admin, Manage, Editor, Member etc User can have multiple roles Every roles has its own dynamic menus and restrictions/resources All menus and interface will populate dynamically from Database
I heard some where this kind of i.e user base security can be implemented using HashTable but I dont know how is it?
Today I came to know that for this kind of work Java people use Interceptor Design patterns. So, how could I do the same in asp.net C#?
Actually I have a datalist in which I am binding product name and product description and there is a hyperlink.
I am binding datalist in page load and checking that user is login or not using session.
if user is login then hyperlink text should be view more
else
hyperlink text should be login to view
The code I have written is working fine but when user is logged in then Only one products hyperlink text changing. I want change it to all hyperlink text to view more when user login
i'm using VB ASP.NET. i'm trying to display some values in Gridview. but i don't know how many columns i need to display. at run time only i will come to know how many columns i need to display. it depends up on the values from Database. so i'm creating columns dynamically and adding to gridview. till that it works fine. but i want some columns value to be hyperlink. so i need to create some columns hyperlink dynamically. for example : if i need to make any chnage for 12/1/2010 john, i can click hyperlink "Work" and update the information. and if i need to add some description for 12/2/2010 John, i can click hyperlink "Add New" and add description for that date.
[Code].....
How can i create dynamic hyperlinks for the date columns. if you have any idea, how to do this,
i want to create a dynamic listbox where items are links (each item is a hyperlink)
here 's my code:
Using sw As StreamWriter = New StreamWriter(Server.MapPath("~/Output/" & weeknumber & ".xls")) Dim hlk As New HyperLink hlk.NavigateUrl = ("~/Output/" & weeknumber & ".xls")...
What is the best way to create a hyperlink to a ListView's items? I'm trying to enable users to simply click on any of the ListView's items, which in turn has to effect that a detailed page for the specific item is opened in a new tab. Right, I got it working by using a Hyperlink component, which is a step closer to my goal.How to make the entire ListViewItem clickable.
In ASP.NET I'd like to create a link which points to a specific Uri and send this link in an email to a user, for instance something like http://www.BlaBla.com/CustomerPortal/Order/9876. I can create the second part of the Uri /CustomerPortal/Order/9876 dynamically in code-behind. My question is: How can I create the base Uri http://www.BlaBla.com without hardcoding it in my application? Basically I want to have something like:
http://localhost:1234/CustomerPortal/Order/9876 (on my development machine) http://testserver/CustomerPortal/Order/9876 (on an internal test server) http://www.BlaBla.com/CustomerPortal/Order/9876 (on the production server)
I want to do something like netflix, where when you hover over something like a hyperlink (netflix, is an image) a panel displays, when the mouse moves off of the control, the panel hides itself.Any suggestions on how to do this and with which control? The AnimationExtender will display the panel, but won't close the panel as I am limited to one Animation.
I am new to website development, so please be gentle!I am having difficulties in stopping a hyperlink to a Excel spreadsheet on my page from being cached by our proxyserver.The spreadsheet is updated on the web server in the background everytime a user updates a sql record, however because the hyperlink is to a static name, when the user clicks on the link, often a older version of the spreadsheet is opened.I have tried many caching parameters without joy and was wondering if it is possible to create a dynamic hyperlink that always looks for the latest version of the spreadsheet ?For example if I append onto the spreadsheet the date and time everytime the spreadsheet is updated, will the hyperlink be able to find it ?All my website code has been written in asp to date.
I have a datalist that gets data from my table . One of the columns is "LinkUrl"which holds a string link to another page.On my aspx page I have the data list and in the item template I want to make LinkUrl Clickable so it goes to the URL stored in the data table
I have a datalist in a page which shows a username in a label from the database (theiruseridLabel)I'm trying to take this username, find its profile.firstname and profile.company name, and then display them as the text in 2 hyperlinks.
i have the code below, but this doesnt work..? can anyone see why? there is no error, just the hyperlinks just show as 'hyperlink' rather than the names i want.
HyperLink hp2 = DataList1.Items[0].FindControl("HyperLink2") as HyperLink; HyperLink hp3 = DataList1.Items[0].FindControl("HyperLink3") as HyperLink; [code]....
using a repeater to display multiple 'comments' related to a parent database entity (a 'task' in my case). When the user creates these comments they can optionally attach a file. Now, I'm working on the page that lists these comments and I'm not sure how to go about displaying the link to the attached file, if one is present. There may not be a file. The database record that contains the comment will also contain the url to the file if one was attached.
what are my options for this? I would like to just display a link to the file after the comment content, only if a file is available.
i had create a webpage by asp.net to show article that placed in Database . the article text contain link of other webpage i had written this link by hyperlink tag in the database like some forum when post new article.
this my text in DB (you can visit us by <asp:HyperLink ID="go" runat="server" NavigateUrl="~/WebForm1.aspx" Text="GO">CLICKING ME</asp:HyperLink>)
i want to know how can i let asp.net dynamically create heyperlink control on the page according to number of hyperlink tag in the text if (1-one hyperlink,2- two hyperlink,... so on)
How can i create a hyperlink to Grid view column, when i click this column it should open Word documentnt.Each Column row values does have seperate information.
i am trying to create a paging facility for my dalatist dynamically and for this i am taking a hyperlink and putting it in a panel and showing the list of pages
but the problem is that when i click on next page for example from 1st page to another then it refreshes the page and opens the page with IsPostback = False and thus my all values that i have stored in a session becomes null like fisrt time loading
so it there any way so that when i click on the link it just show me the next bunch of record without refreshing the page ??
Note: i have created paging in my Stored procedure where each page contains 10 record per page
the code that i am using to bind the pager is as below : where default value of _PageIdx=1 and _totalPages = the number of pages that are coming from the database, it vary from search to another search