MVC :: Cannot Get Way To Direct Controller Url?

Mar 21, 2011

I cant get to directcontroller url (I have change the routing so it will fit into my paging system but I cant fit it also to get the controller url without action (I can gethttp://localhost:51443/home/inde )but I would like to get also "clean" url like http://localhost:51443/home

[Code]...

View 6 Replies


Similar Messages:

C# - Using Grasp Controller With MVC Controller - How To Make An Object Always Visible For A Controller

Dec 28, 2010

UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, that follows the UP(Unified Process). It uses a Grasp Controller pattern to interact with domain classes by some methods like NewSale(), AddNewItemToSale() and CloseSale. In windows form, I can instantiate a object of this class in the UI and then use its methods to perform the actions. This works well in Client apps, but when I use asp.net mvc, I cannot find a way to instantiate an object (one for each user) that was always visible for a Controller (MVC). I cannot insert as an attribute inside Controller because it always create a new one.

View 1 Replies

MVC :: Out Of The Box MVC2 Controller / Delete Controller Is Refusing To Return Any Class Information

Nov 6, 2010

my MVC2 delete and only my delete controller is refusing to return any class information. Its really similar to my edit function and the views are all auto-generated so I don't see the problem.

Function Delete(ByVal id As Integer) As ActionResult

View 4 Replies

MVC :: Pass Parameter From Controller To View And Back To Another Controller?

Aug 16, 2010

I have a simple model where a Person has Gifts. I have a view which is a list of Gifts belonging to one Person.

My problem is with the Create action for a new Gift. I want it to default to the PersonID that we are already viewing the list of Gifts for. I tried simply passing the last PersonID (they are all the same)

Html.ActionLink("Create New", "Create", new { id = Model.Last().PersonID }) which works fine if there is already at least one Gift for that person but if this is the first Gift I don't have a value.

My Gift List controller knows the PersonID I want to pass but the view doesn't.

How do I pass this PersonID from my Gift List controller to my Gift Create controller via the Gift List view? Or is there a better way to do this?

View 2 Replies

MVC :: Session Vs TempData / How To Persist Values From Controller To Controller

May 30, 2010

I have a filter on my MVC web site. I display some records in a few different controller actions but when moving from one action to another I want to apply those filter values.

How can I persist values from controller to controller?

Should I use Session? TempData?

I am using Structure Map for IOC.

Maybe I could have a class that contains a Property for each Session Value that I use in my application and inject it on the controllers that need session?

View 10 Replies

Rendering XMl/XSLT Direct From The Web?

Apr 13, 2010

Im using the ASP.NET Xml control and want to pass it a url to a rss feed and a stylesheet - so that i can style the rss myself on my website. When applying the full web path to the xml control [URL] i get an exception telling me that the document source is not a valid virtual path. What am i doing wrong? I would hate to download the file before showing it...

View 1 Replies

MVC :: Get The Current Action / Controller Name In A Controller Or Class?

Mar 14, 2011

How do you get the current action / controller name in a controller or class?

i can't show it in my view but that's not what i want.

View 1 Replies

Protect Some Pages From Direct Access?

May 24, 2010

I have a ASP.NET page called admin.aspx that needs to be protected from direct access.

I want it to be accessed only when the user enter his name & password in another page called login.aspx I'm working in ASP.NET with Visual Basic .NET 2008,how to do it.

View 4 Replies

How To Prevent Direct Linking To A Few Pdf Files

Sep 22, 2010

I'm working on a website where I need to prevent the direct linking to a few pdf files. I'm using ASP.net 2.0. Is there an easy way in code to do this? or some simple IIS setting?

Right now i'm just using a standard anchor tag to link to the files. i can validate the user on the page containing the anchor tag but that still doesn't stop the user from nabbing the url and passing it on to someone else.

View 4 Replies

How To Stop Direct Urls Being Typed In 2.0

Jun 14, 2010

I have a website that has a members section. To view a members profile I pass the username across the query string, but I want to stop direct access by someone changing the url to a different username.

Do I need to encrypt the query string or is there a better way to acheive this ?

View 3 Replies

Security :: Denying Direct URL Access?

Jun 28, 2010

I need to restrict access to pages based on permission given to roles based user .Roles created dynamically so that i can't restrict thru the WEB config file .i am using the custom sitemap so menu is showns correctly based on roles , but if we enter direct url in address bar we can access that page although its not permitted for the user .is there any other way to redirect to common access restrict page .

View 3 Replies

Denying Direct Access To A Webpage?

Mar 11, 2010

I have a webpage errors.aspx that needs to be protected from direct access. I want it to be accessed only when redirected to by another web page.

View 3 Replies

Security :: Re-direct Particular Page After Login?

Sep 28, 2010

how to redirect to particular page after login. I have login,EDetails,home page..

1.If the user login very first time(suppose he does not have any personal details) he should be directed to EDetails.aspx

2.User who submitted the personal details already should be redirected home.aspx page.

I have 2 tables later i will add more,1.login table,2.employee detailed table.I am using Login control for login page

I am using Version ASP.Net3.5 with MySql database, Code where i am redirecting in login page

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
If YourValidationFunction(Login1.UserName, Login1.Password) Then
Login1.Visible = False
Session("UserName") = Login1.UserName
Response.Redirect("EDetails.aspx", True)
Else
e.Authenticated = False
End If
End Sub

View 5 Replies

C# - Event Triggering Without A Direct Connection?

Feb 2, 2011

In my ASP.NET app I have a control in the master page that raises an event Foo on certain occasions / interactions.I also have a couple of pages that have another control that must re-bind itself when this event is fired.Unfortunately the only way I can see them communicating between each other is by creating a long event chain (deriving a new MasterPage MasterPageSuperDuper, attaching an event handler to Foo's event in the user control, and then referring to this event in the masterpage from the control present in a couple of pages - basically using the masterpage as a control center).

View 2 Replies

ADO.NET :: Direct Qurry Or Lamda With Extension ?

Mar 13, 2011

IEnumerable<Product> selectedProducts = (from p in products where p.Category == 1select p);
selectedProducts = products.Where(p=>p.Category==1) ;

The above 2 statements seems to produce same result .TheN what is the diffrence? which one is efficicent more?

View 1 Replies

Web Forms :: Layout A Web-application Without The Direct Use Of HTML And Css?

Jul 7, 2010

Are there possibilities to layout an ASP.NET web-application without directly using CSS and HTML ? I am mainly coming from the desktop-development world and I am in the first place familiar with the usage of layout- and container-controls like panels, tables, and so on.

View 2 Replies

Direct SQL Execution To Get Count Using Enterprise Library

Mar 16, 2011

I am new to asp.net development and using enterprise library in my application in the following way.

Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand("sp_MakePayment");
db.AddInParameter(cmd, "@BillGenID", System.Data.DbType.Int32);
db.SetParameterValue(cmd, "@BillGenID", billgenID);
db.AddInParameter(cmd, "@PayDate", System.Data.DbType.String, 50);
db.SetParameterValue(cmd, "@PayDate", mypaydate.Text);
db.AddInParameter(cmd, "@TransNo", System.Data.DbType.String, 50);
db.SetParameterValue(cmd, "@TransNo", transno.Text);
db.AddInParameter(cmd, "@AmtToPay", System.Data.DbType.Double);
db.SetParameterValue(cmd, "@AmtToPay", Convert.ToDouble(paidamount.Text));
////Execute Stored Procedure
int i = 0;
i = db.ExecuteNonQuery(cmd);

Now I am in a situation where i need to run this inlnie query using the same method to get the count of records and read in a variable. for example following query to find existing bill.

string bill_id = "1234";
string dofpayment = "11/03/2011";
mysql = "Select count(*) from payments where bill_id = " + bill_id + " and payment_date = " + dofpayment ;

Now how to incorporate the above lines using the enterprise library block.

View 2 Replies

Security :: How To Direct User When Login By Roles

Jan 27, 2011

How to Direct Users to specific Page By roles?

View 10 Replies

Crystal Reports :: Direct Printing Without Converting Into PDF?

Apr 3, 2010

I am using asp.net 2.0 and crystal. When I click on print button on tollbar of crystal report. Report is converted to pdf but I don't want to view this report in pdf it must ask for the printer and directly print the report, rather than opening report in pdf and printing.

View 2 Replies

Web Forms :: How To Prevent The Direct Call Of URL In IIS Environment

Aug 2, 2010

How can I achieve in an ASP.NET application, that a set of URLs/ASPX pages (parts of the application) cannot be called directly from the user in the Browser? These urls/pages may only be referenced in the application itself.

View 2 Replies

Databases :: Direct Download From BLOB Column?

Nov 12, 2010

i need to download a file directly from a table's BLOB column .

i used this procedure, but i got the error:

SQL> exec download_blob;
begin download_blob; end;
ORA-06550: line 2, column 7:
PLS-00905: object IFRSCD.DOWNLOAD_BLOB is invalid
ORA-06550: line 2, column 7:
PL/SQL: Statement ignored

The code is:

[Code]....

View 2 Replies

Security :: Deny Pages From Direct Access?

Dec 28, 2010

I have certain pages in my application that are designed to be accessed only by redirect from other pages, and not directly(i.e they must get a query string from other page, otherwise there is an exception).

So I want to prevent users from accessing them by typing the URL, but I want them to be available by redirect.

View 1 Replies

Security :: Restrict Pages Direct URL Access?

Mar 17, 2010

I have a security issue in my web application where user can enter malicious data/can change the page path directory. To avoid these i want to restrict the user by accessing/typing in the URL.

View 5 Replies

Security :: Disallow Direct Access To Files?

Aug 19, 2010

Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

View 2 Replies

Web Forms :: Force Direct To Entry Page?

Jun 17, 2010

I'm not sure if this is the best category for this one... Might be more appropriate in the navigation section.I am curious as to the standard for redirecting users to a entry page on first accessing a website. In my case, I am working on an adults only website that requires a warning for users that the content is only appropriate for users over 18yo, as well as containing the scripts to activate several different monitor systems to prevent children from accessing the site.

I know I can use session_start to redirect and check for a cookie... but that seems heavy. Is there a better way? Something in IIS or... something I have not thought of yet?

View 5 Replies







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