I have to create a framework 4.0 website, is it possible to reference a dll of the data layer( the data layer is an other project in framework 3.5) in my website? The main reason of this is I want to reuse the datalayer of the application which is very huge.
We have a web application(.net 3.5 on IIS7) which is currently referencing a specific version of a third party dll (abcpdf6.dll). I would like to move this reference from the project to the web.config and assign it an alias so when a new version becomes available I can just change the reference in one place.
I would like to have several websites that use the same styles, scripts, and App_GlobalResources. What would be the best way to structure my websites (web applications) to use the same files? I also need to share user controls with code behind.
My current project has many peripheral systems and many different environments (testing, integration, development etc). As expected, we're using .config files to dynamically manage everything.
Instead of updating each relavant key when deploying to an environment, I was hoping there was a way to change 1 key only. Such as:
I've done some searching and haven't come up with an elegant solution. I'm aware that .config files can make use of system variables, but this seems like a bit of a high wire act.
In almost every ASP.NET MVC example I've come across, I always see Url.Content being used to reference CSS, JavaScript, and Images. Not once has anyone explained WHY to use it.
I keep trying to add an assembly reference to my website which doesn't show up anywhere in my code. Specifically, I would like to add a reference to System.Xml.Linq.dll to my website. No such reference appears in my web.config file. Also, when I right click on the website in the Solution Explorer window, go to Property Pages, and then click on References in the left-hand column, System.Xml.Linq does not appear. Yet, when I right-click on the website and go to add reference, I ultimately am met with the error:
"The website is already referencing the assembly 'System.Xml.Linq'"
Also, when I put a using statement at the top of one of my classes in my App_Code folder for the System.Xml.Linq namespace, the Visual Studio IDE does not flag it as an error.Any insight into this strangeness would be very much appreciated. I'd like to put this into production someday, and I'm worried it might not work due to a missing reference. The version I'm currently using is Visual Studio 2010 Professional Edition.
I have a label control on my MasterPage that is used to display error information. If an error occurs on another aspx page or a Module.vb page, how can I display the exception in the label control on my MasterPage? I tried using a Session variable, however, it would not work in my Module.vb code-behind file.
I have a Master Page that contains a Menu Control. Each menu item clicked is supposed to load a new aspx page. My problem is (since I'm new to Master Pages) actually loading a Content Page. This is what my MP code looks like and it's only just a snippet. The first set of code are the ContentPlaceHolders in my MP. The second set is the code in my code-behind file in my MP. Hope this makes sense. In the VB code, all I'm trying to do is load my Customer.aspx page. What am I missing?
Code: Private Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick Try Select Case e.Item.Value Case "mnuCustomerMaintenance" MainArea.Page = Customer End Select Catch ex As Exception End Try End Sub
I have written a custom membership provider for my MVC 2 app, and it all works fine. I wanted to force people to log in as soon as they went to the site, so set the authorization section of the web config to deny annonymous users. As expected, when you try and access the site, it re-routes you straight to the LogOn.aspx page. The problem I'm having is that when it initially jumps to the LogOn page, it cannot find any of the files referenced in the html header section.
The strange thing is I set a path to a css file as follows:
../../Content/site.css yet in the page it shows up as ../Content/site.css
I even wrote a html helper that uses Url.Content on the paths passed in, but this still does not solve the problem. If I go to the LogOn page after the application has initially loaded, it references all the files correctly.
How do you reference a LINQ object that you have created such as a list, in your HTML? I have seen examples of how to do this using MVC, but I am using Web Forms. Here is my LINQ :
[Code]....
And I want to be able to for example check if my linq returns any data and if so iterate through it using a foreach loop in my HTML. change my linq so that it returns a generic list rather than what it is doing at the moment.
I have a control that I use to populate a cascading menu with LinkButtons. All link buttons have the same OnClick event that I want to use to load content as well as change the clicked button's color to show the user which LinkButton they have selected.
My problem is that I don't know how to access any LinkButtons other than the one that is calling the OnClick event, so any colored button remains that color when other boxes are selected.
Is there any way I can reference all LinkButtons within a Panel to clear their colors so only the selected LinkButton is colored?
I have a utility project that has an "XML" folder with two XML files in it, this project is then referenced by an ASP.net web project. I was wondering do you have to set some sort of build option to place the folder in the BIN of the website, or is there another approach to referencing these two files from the web project?
I have a web site that is hosted by Network Solutions. The hosting package I have includes support for ASP. I can place a simple aspx page on my web site and point to it with my browser and it appears to execute. What I'd like to do is reference a text file (for parsing) that is in the same folder as the aspx file. I have no idea what the absolute path is to the folder. How can I reference the file for reading if I don't know the absolute path?
I thought this would be easy but i cant find what i am looking for online
I have 2 pages, the first 1 has a button that opens another page. On this 2nd page the user selects a picture. When the user selects a picture the form closes. When they select a picture i want the image control on the first page to change.
I'm not sure how to do this, i guess i could set the image path as a session variable and reload the first page but again i'm faced with the problem of how to reference the first page from the 2nd
My displaycloud.aspx page contains two databound data lists, each for displaying a tag cloud. The datalists have an EmptyDataTemplate that holds an empty label if nothing is retrieved from the db. I am trying to display the message 'Please Log a Story', by using the code below on the companyadmin page, but I am getting an error (the controls are not on the same page). How can I reference the labels positive_tags and negative_tags from displaycloud.aspx in companyadmin.aspx? Also, I want to redirect if the EmptyDataTemplate is not executed as shown at the very bottom of the page.displaycloud.aspx:
Probably really easy but in my VB code I would like to say
If webpage = "ErrorPage" then do seomthing End if
So the thinking behind this is that if the ErrorPage is the open page on my site it feeds that into the webpage variable and then that runs the If statement.
I'm trying to set a value for an HTML Element within my code-behind. I need to set a <div> elements "display" property to "inline". The way I have it coded is like this:
Code: divContact.Style("display") = "inline"
Is this the right syntax? I only ask because it doesn't seem to work but I don't get a run-time error when the statement is executes. ???
I have a gridview that has a hyperlink field in one of the columns. My question is how do I can I reference the the hyperlink's datatextfield when I click on the hyperlink? The field is a PDF that is stored in the data base and I need the datatextfield to reference the record in the db.
Does anyone know how to do this? I built a backend c# class in asp.net but want to access these same classes without recreating them in silverlight. Is this a possibility?
I'm displaying a table based on query results, and each record has a dynamically generated dropdownlist and submit button (and other controls, but this is simplified). That part works fine, but how do I reference the controls in a function? Here is the code I've tried. Create the controls:
[Code]....
Reference the control values (hopefully):
[Code]....
The function SubmitAction_Click fires when I click the Post button, so that part works. I just can't figure out how to reference the selected value of the dropdownlist. You can see that I'm explicitly giving the DDL a unique ID (DS_RecordID). I'm guessing I have to use FindControl to reference it, but I don't know how to format the code.
I am using url routing to route user to his profile page. This profile page is a child page and is at the root directory. The css, javascripts are in css,js sub directories. Now the problem is of referencing in master page. All of the pages of the website runs smoothly except the page reached after url routing. This explains the problem i am having : [url]
I have used ResolveURL and URL.Content but this again shows up error saying me to missing an assembly directive. These are the other ways i tried in the master page:
Or Is there anyway to redirect the user again as the usual site ran before url routing i.e. on clicking the Home menu now the user is redirected to ...com/user/home.aspx whereas home.aspx is in the root domain. I am using this on the menu: <a id="A1" runat="server" href="~/Home.aspx">Home</a>