I use url routing according to this article [URL] .....
In global.asax i use this code
public static void RegisterRoutes(RouteCollection routes) {
routes.Add("BikeSaleRoute", new Route (
"{Data}/",
new CustomRouteHandler("~/Details.aspx")
));
}
Here when I write behtob.com/1111 or behtob.com/test it go to details.aspx page i want instead of {Data} it read behtop column from my DB and according to that behcode it go to details.aspx and fill that page with user's information that have behcode in address bar i want bind it from data base
Id Behcode Name Description image
1 2222 Iron Test 1.jpg
4 3333 Laundry Test 2.jpg
ASP.NET 3.5 SP1 with Web Forms Routing thru Global.asax (System.Web.Routing and RegisterRoutes)IIS 7
Everything is working fine in my local machine, but it gives the following error in my hosting environment:
Could not load file or assembly 'System.Web.Routing, Version=3.5.0.0, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I did everything inside my web.config file mentioned in the following link:
I have a Web application where i have added a reference to a RESTful WCF. I got the WCF url Routing to work in my webapplication by adding Inherits="RestService.Global" to the Web applications Global.asax.
But then i tried to create url Routing for the Web application and it does not work with the Inherits="RestService.Global" in the Global.asax. If i take it away it works fine. Is there a correct way to do this.
I'm trying to create my own CMS and I've gotten a little bit stuck at the stage of URL routing.
I want clean URLs without extensions and I'd like to be able to create and modify them in a web based interface without any messing around with IIS or actual files.
I've seen how to create a static route, but for that I need to go into my Global.asax file and manually add it.I would like to have all of these routes stored in a database so that I can easily modify them later.
Does anyone know how this can be achieved?
Just for extra information, I will be attempting to create a feature so that if a path exists, but is later changed, a 301 redirect is created to the new URL, is this also possible? (My first problem is the main issue, but thought I might ask this as well just in case it makes a difference)
I have an Infragistics WebDataGrid on a user control. I add that user control programmatically to an UpdatePanel on a Content Form. Everything works great. I get data in the grid just fine. However, when I go to click any of the grid functions (Sort, Filter, Page, etc.) it throws a Sys.ArgumentException in one of the ScriptResource.axd dynamic files.
Here is the error:
"Microsoft JScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON. Parameter name: data"
It stops in the following function:
[Code]....
I read about other people having this issue and they said it was due to dates or due to double quotes ("") being in strings? I am binding this datagrid to an Entity Data Framework object query like this.
I'm populating a DataList using the IDataReader object and it works fine it the reader contains data. If the data is not present it displays nothing. I want to capture that situation and insert a verbiage such as "No data" or something like that. I've tried to test the datareader for various conditions such as Null, String.Empty, or plain " " but nothing worked. Is there a way to make this happen? Below is my code sample for your review.EJM.Note: It has to be done programatically as I'm building this for a web part.
void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRoutes(RouteCollection routes) { routes.Add("BikeSaleRoute", new Route ( "bikes/sale", new CustomRouteHandler("~/Details.aspx") )); }
here when we type eg:[URL] it go to details.aspx now i want instead of bikes/sale that define here it read Behcode column from DB and when my user type their becode like this [URL] it go to details.aspx
There is select and update SQLs in sqldatasource and checkbox in formview which is 2way databinded to an sqlserver bit field type.
it always gives same error
Specified cast is not valid
I excpect nobody posts me an "eval" solution.because update is a need for checkboxes which are attached to a bit field.
a ready-to-use small sample project with DB I attached HERE
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
bolded part for extracting date in a label( lblRequestDate). is it ok by point of view security (I never get an error although the data may be complex)
How to handle asp.net mvc routing along with asp.net webform routing. I have merged my mvc app into my existing web application. In my web application i have implement routing as below:
routes.Add("View Product Details", new Route("Product/{City}/{Manufacturer}/{Name}/{ProductID}/{*ProductType}"));
Similarly i have implemented routing in mvc as below
i am using visual studio 2008 vb. i have a dropdownlist in my detailsview populated with product id. when i select an id, the product name will appear on a label. however, when i change the product id in the dropdownlist, an error occur "Conversion from string "ProductName" to type 'Integer' is not valid." Here's the code file.
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim lbl As Label = DetailsViewOrderDetails.FindControl("Label4") Dim ddl As DropDownList = DetailsViewOrderDetails.FindControl("DropDownList1") lbl.Text = ddl.SelectedValue("ProductName").ToString() End Sub
I am developing web application using csharp on visual studio 2008. I am loading the data from Microsoft Excel to datagrid. But when I want to check the date in a given column and getting the error String was not recognized as a valid DateTime . How can I solve this problem? The code I am using is below.
I have a datalist menu,that has few menuitems.each menuitems should load a usercontrol in seperate dynamic tab panel.but when I click on menu for third time I faced this runtime error:"Specified argument was out of the range of valid values. Parameter name: value" on pageload method in line : PlaceHolder1.Controls.Add(newtabCon);
I have a datalist menu that has several menuitems in it(each item load user control).I want to show each menuitems in seperate dynamic Ajax tabs when I click on first item tab is created but when I click on second menuitem to create second dynamicajax tab I faced this error:
I need you assistance, Dynamic Delete LinkButton with CommandName=Delete gives me an error: Delete can only be called on a valid data item. nfact I am designing a Complex Grid using .Net 3.5 ListView Control with Scrollbar and Fixed Toolbar: This grid consist of 3 Tables:
1- footer 2- Toolbar Control 3- Scrolling Data Grid with Header
ListView give us only one ItemPlaceHolder to Bind Data as per LayoutTemplate, so I cannot able to manupulate my Toolbar Controls with ItemTemplate :(, therefore I decide to use ItemDataBound to add ImageButtons Dynamically using Init Page Event and I am able to get the result as you saw above:
ImageButton with funnel icon is with CommandName="Filter" ImageButton with magnifier icon is with CommandName="View" ImageButton with stop icon is with CommandName="Delete"
Now I can able to handle Filter and View with OnItemCommand Event but when I click Delete button I am getting an error as shown below: The grid used CSS I am sending you the HTML and code behind to resolved this problem: HTML CODE:
I've always been a bit unsure how to check for the existance of properly referenced table data.
In my situation I have various tables related to each other in many-to-one relationships where the "1" side can be deleted without the reference fields on the "many" side being updated (nulled).
I have FK relationships set up in my MS SQL server database but have turned off the FK constraint enforcement (and cascading update/delete) so that I can delete records from the "1" side but leave the keys for those deleted records in the records on the "many" side. This is something I really need to do for my web app design.
I'm using Sys.Serialization.JavaScriptSerializer.deserialize to deserialize the json. unfortunately I got an error saying that my data does not correspond a valid json.
I have a FormView that allows a user to register for a company event. I want to do a couple of things with this form.
1. I need to write this data to a MS SQL database
2. I need to send an email confirmation of their registration to their email.
I know how to do both of these things, but i am having trouble doing both at the same time.
It would be nice if I could do it in one click, but I coded it into two pages to try to help simplify it.
The first page allows the user to input their information into a formview and when they click the submit button, it places those answers into session variables:
[Code]....
[Code]....
The Second page confirms the users information by taking those session variables and placing them into labels:
[Code]....
[Code]....
However, after I place information into the formview on the first page, it throws up this error:
"Conversion from type 'TextBox' to type 'String' is not valid".
I have a gridview which I'm trying to get the display of phonenumbers listed in a certain display format; (xxx) xxx-xxxx.If I have the code such as this, it displays the unformatted phone number and (000) 000-0000 for the null items.
This is all in the Code Behind under the Page Load function.
Basically, I'm trying to convert an ASP page into ASP.NET. I've worked with ASP and PHP a lot more than I have with ASP.NET and I'm just having trouble with the syntax.