MVC :: Wrong URLs Retrieved With GetVirtualPathForArea And GetVirtualPath?

Dec 6, 2010

I am teaching myself MVC 2 and using the MVC paging project code from Martijn Boland, located here:

[URL]

The code works great if I use the default routing for my project, but I'm using shortened URLs for a couple of views, which is resulting in the wrong page links being retrieved for one of them.

Here is what my global.asax.cs file looks like:

[Code]....

View 17 Replies


Similar Messages:

State Management :: Data Being Saved To Wrong Table In Wrong Instance Of Sqlserver Of Wrong Database?

Aug 1, 2010

I have a weird thing happening. I have two identical databases installed on one virtual machine but under two different instances of SQLServer. For some reason, periodically when saving from one it will save to the other instead. Using debug, I have verified that the connection string is correct and when the item saves, it still saves to the wrong database.I use session variable, and am of the belief that it might have something to do with it...and t hat when I go from one to the other it is still getting the connection string form the other for some reason.To make sure that it isn't a problem, I make sure that I completely close out one database before opening the other in a new IE window.I assume that when I completely close out an internet explorer window that it abandons all session states. Is that true?

View 7 Replies

Logic For Fixing Relative Urls To Full Urls

Nov 16, 2010

i have a function that pulls URLs from various web resources. needless to say some are full valid URLS and some are relative as per the HTML of the page. below is my asp.net/ c# logic i derived for examining the URL and then generate a full usable URL from whats pulled from the site...

NOTE:
origianlurl is the full url of the first searched page, and relativeUrl is a url found within the searched page (it can be a full www.site.com or a /contactus.html)
private string ResolveRelativePaths(string relativeUrl, string originatingUrl)
{
if (relativeUrl.StartsWith("http") || relativeUrl.StartsWith("www"))
return relativeUrl;
if (relativeUrl.StartsWith("/"))
{
//get main url something.com
[code]...

View 1 Replies

ADO.NET :: Data Saving To Wrong Database On Wrong Instance Of Sqlserver

Aug 1, 2010

I have a very weird thing happening. I have two databases that have exactly the same tables but different database names on the same virtual machine, but in different instances of SQL Server. For some reason, when using one of them, it will save to the other. In debug, looking at my connection string..I have verified that it is correct, yet when I allow the save, I look in the table and it isn't there, it is in the other database that is in a table with a completely different name and in a different instance of SQL Server.

View 1 Replies

MVC Authentication Cookie Not Being Retrieved

Jun 7, 2010

I am having a hard time implementing "Remember Me" functionality in an MVC application with a custom principal. I have boiled it down to ASP.NET not retrieving the authentication cookie for me. I have included a snaphot below from Google Chrome.

Shows the results of Request.Cookies that is set within the controller action and placed in ViewData for the view to read. Notice that it is missing the .ASPXAUTH cookie Shows the results from the Chrome developer tools. You can see that .ASPXAUTH is included here.

Does anyone know what the issue may be here? Why does ASP.NET not read this value from the cookie collection?

My application uses a custom IPrincipal. BusinessPrincipalBase is a CSLA object that ust implements IPrincipal. Here is the code for that:

[Code]....

I do not think that any of this is related because the bottom line is that the Request.Cookies does not return the authentication cookie. Is it related to the size of the cookie? I heard there are issues to the size of the cookie.

UPDATE: It seems that the issue revolves around subdomains. This site was being hosted with a subdomain and the cookie domain was left blank. Does anyone have any pointers on how I can get the auth cookie to work with all domains (e.g. http://mydomain.com, http://www.mydomain.com, and http://sub.mydomain.com)?

View 3 Replies

Possible To Add Links To Retrieved Database Values?

Apr 27, 2010

I hope I can explain myself properly. What i'd like to do is be able to add a Search form where users can search various criteria based on my Orders table. I was hoping to add the capability to click on one of the OrderID's to display the fields from the Orders in the various text boxes on my form. This would allow the users to search, and update all in the same page. I have the data retrieval portion down pat, but am not really sure how to give them useful links. Is this possible? Or is there a better approach that I could take?

View 6 Replies

Web Forms :: How To Add Days To Data Retrieved From Database

Feb 22, 2011

i retrieve a data named semesterstartdate, after retrieving i neede to add day to the data. How can it be done?

View 2 Replies

Web Forms :: How To Print Data Retrieved From Database

Feb 20, 2010

this information is i retrieve from database.

like for vb.net it has a function called print screen. for C#, is it possible to print it? if the user clicked a print button on the screen?

View 10 Replies

State Management :: SQL Session / Value Won't Gets Retrieved By Application2

Mar 1, 2011

in my sample code,I have used SQL Server session mode where Application1 stores the value into session and Application2 retrives the stored value.

My web.config is like

[Code]....

and Storing session using below code where StudentInfo class in searializable.

[Code]....

Issue is : Application1 stores the value into database ( I can see it on table) but same value won't gets retrived by Application2.

View 10 Replies

SQL Server :: Maxlength Of A String When Retrieved Via Executereader?

Mar 7, 2011

Dim reader As SqlDataReader
reader = cmd.ExecuteReader
Dim XML As String = reader("records").ToString

I've executed the command in SQL server and I get a result string with length of 54781But when I execute it via .NET and assign it to the XML variable, the length of XML is always 2033...so now Im thinking that the result column "records" cannot exceed this length for some reason...

View 7 Replies

DataSource Controls :: Database Schema Could Not Be Retrieved?

Nov 18, 2010

I recently installed the latest Oracle Data Provider for .NET(ODP.NET 11.2.0.1.2), due to the fact that Microsoft Oracle Client is deprecated. Ever since the new installation, my SqlDataSource control stopped working. When I try to configure the data source of the SqlDataSource and test the connection, it always gives me the following error message:Database schema could not be retrieved for this connection. Please make sure the connection settings are correct and that the database is online.

OCIEnvCreate failed with return code -1 but error message text was not available. at DataObjectSupport(721,6)

I know for sure the connection settings are definitely correct and the database is online for sure, because any databinding I did manually works perfectly well. I can manually bind to a Gridview, ListBox controls and display the data without any problem. The only problem I have is using the SqlDataSource. This is painful because Gridview and Listview have a lot of cool built-in features. When you databind the controls in the code behind file, you lose all the features.

I have added ASPNET to the Oracle home directory and granted it full control access and retarted the computer but it doesn't work. I'm using Visual Studio 2010 and the database is Oracle 10g. Does anybody know why I'm having problem with SqlDataSource only?

View 1 Replies

MVC :: Restrict The Columns Retrieved According To The Login User Id?

Dec 23, 2010

I have an article table, I am using the login mechanisms provided my MVC2 , since it contains all the required functionalities that i need.(but i do not know what are the database tables that store these information) What i need is to display all the articles created by the login user. currently i am retrieving all the articles from the articles table , as i am not able to retrieve the login name to add it to the following query . the query code looks like this (which is part of the repository class which i have created):-

public IQueryable<Article_Type> FindUserArticle()
{
return from article in db.Article
// where article.createdby >= ???
orderby articletype.Article_Type_Id
select articletype;
}

View 3 Replies

DataGrid Header Text Set Dynamically But Not Being Retrieved

Mar 26, 2014

I have a DataGrid defined with columns such as:

Code:
<asp:BoundColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%" DataField="MONTH_PREVIOUS_YEAR" HeaderText="Month Hours (Previous Year)" ItemStyle-HorizontalAlign="Right"></asp:BoundColumn>

At a certain point in my program, I successfully re-set some of the Header titles programmatically:

Code:
Private Sub dgAccountability_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgAccountability.ItemDataBound
If e.Item.ItemType = ListItemType.Header Then
Dim previousYear As Integer = (Integer.Parse(year) - 1)
e.Item.Cells(1).Text = "YTD Hours " & previousYear.ToString

[Code]....

View 3 Replies

VS 2008 Change Data In Gridview When Retrieved With SQLDatasource?

Mar 10, 2010

When the data is retrieved through a stored procedure using the SQLDatasource control that is binded to a gridview control, I want to change some data that is in some of the columns. Can i do this in one of the events either in the gridview or data control? I know you can do some formatting on the aspx page side such as dates, etc. but was wondering if I can do it on the vb code side?

View 8 Replies

Web Forms :: Populate DataSet With Asynchronously Retrieved DataTables?

Oct 18, 2010

I need to asynchronously retrieve several resultsets which I store in DataTables and add these DataTables to a DataSet. When the final DataTable is filled and added to the DataSet the page must then continue processing utilizing this DataSet I have figured out how to implement delegates to asynchronously retrieve my DataTables but I'm unclear how to add them to a DataSet in a thread-safe manner. How is this best accomplished? Before processing I know how many DataTables there will be, so what is the best way to track the progress of the asynchronous retrievals and allow the page to continue only after I have all of the data?

View 3 Replies

Web Forms :: Save Word Document Retrieved From SQL Server?

Jan 4, 2011

Now I can upload image/Word document and store it in to our SQL database.

Also I can save image retrieved from our SQL database.

But I am having problem with retrieving Word document.

Right now I am doing this for word document:

[Code]....

This works, but IT ONLY shows in the browser. (I WANT TO SAVE THIS AS .DOC IN ONE OF OUR FOLDER)

For images (*.jpg *.gif) I can save it in our folder. Like this:

[Code]....

This saves as temp.jpg in our Temp folder.

I want to do exactly the same with word document.

But I cannot use Bitmap as image. It gives me error...

View 5 Replies

State Management :: How Session Values Are Remembered And Retrieved

Apr 22, 2010

when designing E-commerce website or shopping cart we call session value from login and we use it anywhere we need,but i want to know how session values are remembered and retrieved??i mean where they are stored and how it will be accessed

View 4 Replies

ADO.NET :: Assign Datatype Of Attribute Retrieved Using SQL Query To String?

Aug 3, 2010

How it is possible to assign datatype of an attribute retrieved using sql query to a string? for eg:

SqlCommand cmd = new SqlCommand("select data_type from information_schema.columns where table_schema='dbo' AND table_name=table1 AND column_name=column1, con);

I want to assign this datatype value to a string. How it is possible?

View 4 Replies

WebMatrix :: Change Cell Color On Retrieved Data?

Feb 5, 2011

I have the following code in my webmatrix project

[Code]....

What i need to do is to make one of the cells change colour depending on the result. So say if the What column showed 1, 2 or 3 or would show in the table red green or amber.

View 5 Replies

Display Crystal Reports From Data Retrieved From Session?

Nov 3, 2010

I have this asp.net website that generate records of Staff. As you type staff's Id no. in a texbox and click the 'Generate record' button, the page will be redirect to the another page of which the report has to be viewed.

In my first aspx.cs (session.aspx):

[Code]....

I have my report.rpt which I have already populated with designated fields like:

Staff_No, First_Name, Middle_Name, Last_Name

Also, I have already drag the CrystalReport Viewer from toolbox in my second page.

That's all what I have done. Any thing that I forgot to do, I do not know.

I got no errors. But when I run it in the browser, the report does not displayed in the browser and I got this "The parameter is incorrect" text at the end of my browser.

-- I'm using SQL server for my database, Visual Studio 2008 (C#) for the codes and everything..

View 2 Replies

Web Forms :: Populate / Add DataSet With Asynchronously Retrieved DataTables?

Jul 9, 2010

I need to asynchronously retrieve several resultsets which I store in DataTables and add these DataTables to a DataSet. When the final DataTable is filled and added to the DataSet the page must then continue processing utilizing this DataSet I have figured out how to implement delegates to asynchronously retrieve my DataTables but I'm unclear how to add them to a DataSet in a thread-safe manner. How is this best accomplished? Before processing I know how many DataTables there will be, so what is the best way to track the progress of the asynchronous retrievals and allow the page to continue only after I have all of the data?

View 6 Replies

Web Forms :: Can Construct A Tree View From XML Retrieved From Database

Jul 20, 2010

I want to create a Tree View using XML that is fetched from SQL Server. How I can directly assigned to tree view, the below code I tried, but throwing error 'dsXML' is not an IHierarchicalDataSource. The XML heirarchy is proper. When I use XmlDataSource with the xml file, tree view is shown.

<asp:SqlDataSource runat="server" ID="dsXML" ProviderName="System.Data.SqlClient"
ConnectionString="Data Source=Server;Initial Catalog=database1;Persist Security Info=True;User ID=userid;Password=password"
SelectCommandType="StoredProcedure" SelectCommand="spGetXML">

[code]....

View 1 Replies

Web Forms :: Images Retrieved From Database Show In IE, But Not Firefox?

Mar 9, 2011

I apologize if this is the wrong sub-forum for this question, if it is please let me know a better sub-forum to ask this.Anyway, I have a table in my database with a photo column that points to the location of images all under the same root, like this: Y:playerPhotosplayerName.jpg

When I select a specific photo using a stored procedure in my aspx.cs, then read the image path using a sqldatareader like this

while (sdr.Read())

{

string filepath = sdr.GetString(0);[code]....

it works fine and the image shows in Internet Explorer (version 8), but doesn't show in Firefox (version 3.6.4) I think it has to do with the direction of the slash, but I'm not sure. Is there anyone out there that has run into this broswer problem?Basically is there a solution to changing the value of the image's filepath string if the browser is Firefox?

View 4 Replies

AJAX :: Autocomplete Control With Textbox For Data To Be Retrieved From Database?

Mar 3, 2011

Having a problem with autocomplete I put autocomplete control with textbox For data to be retrieved from database, I am putting .asmx file and .cs file for that Now I am giving .asmx file path in autocomplete. asmx file contains path for .cs file If this is the situation, autocomplete dont work and in .cs file , event is not fired.

But if i put that event from .cs file directly into the codebehing file of that control, then it works ok

How can i call an event in .cs file that is placed inside a app_code folder seperately from .aspx and .cs file of the autocomplete control

View 1 Replies

JQuery :: Slideshow Of Album Covers Which Are Retrieved Dynamically From The Database?

Jul 15, 2010

I was wondering if anyone knows a jQuery library that can suit my needs:

I want a slideshow of album covers which are retrieved dynamically from the database. I want to display 4 album covers at a time. I want there to be a next button so the the slideshow can continue. Here is what I cant find any librarys for. When I click the next button, I dont want to show another 4 different covers, i want it to move along by 1 album cover,

So say I had covers 1 , 2 , 3 , 4

When i click next i want to display 2 , 3 , 4 , 5.

Finally, I want the show to be able to repeat so at the end it starts at one again.

So say I only had 5 covers 1 , 2 , 3 , 4 , 5

when I click next while showing 2 , 3 , 4 , 5 I want 3 , 4 , 5 , 1 displayed.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved