Search Results

Search found 59301 results on 2373 pages for 'asp net ajax'.

Page 153/2373 | < Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >

  • Not getting redirection to custom error page using custom errors - ASP.Net

    - by weevie
    Here's my Application_OnError event sink in global.asax.vb: Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs) Dim innerMostException As Exception = getInnerMostException(Me.Context.Error) If TypeOf innerMostException Is AccessDeniedException Then Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException)) Dim fourOhThree As Integer = DirectCast(HttpStatusCode.Forbidden, Integer) Throw New HttpException(fourOhThree, innerMostException.Message, innerMostException) End If End Sub You'll see that if we've got an innermost Exception of type AccessDeniedException we throw a new HTTPExcpetion with a status code of 403 AKA 'forbidden' Here's the relevant web.config entry: <customErrors defaultRedirect="~/Application/ServerError.aspx" mode="On"> <error statusCode="403" redirect="~/Secure/AccessDenied.aspx" /> </customErrors> So what we're expecting is a redirect to the AccessDenied.aspx page. What we get is a redirect to the ServerError.aspx page. We've also tried this: Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs) Dim innerMostException As Exception = getInnerMostException(Me.Context.Error) If TypeOf innerMostException Is AccessDeniedException Then Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException)) Context.Response.StatusCode = DirectCast(HttpStatusCode.Forbidden, Integer) End If End Sub Which unsuprisingly doesn't work either. Any ideas what we're doing wrong?

    Read the article

  • Removing a querystring from url in asp.net

    - by user279521
    HI, I need to remove a querystring when a user clicks a particular LinkButton. So for example if the querystring is http://UserProfileManager.com?UserID=1234 .... when the user clicks on the Linkbutton, I want the url to be http://UserProfileManager.com. The issue is that everything is on one page, and I am using Any ideas would be appreciated.

    Read the article

  • Asp.net error object not set to a reference

    - by Frank
    Hi all, Because I rush in development (a lot of whip cracking here) and declare my objects at the top of the function and instantiate inside my try-catch block, I get a lot of the good old "object not set to an instance of an object" errors while doing TDD, and later if I do miss a branch that object was used in (doing VB now, would prefer C#) or just in every day coding, object not set to an instance of an object is a bit vague. Sure the stack trace sends me to the line the error occured at, but it would be nice if I could modify my logging to either name the object or its type because sometimes I have multiple objects on the same line. It's not the end of the world, but in the end it would save me a few minutes each day. Any ideas on how I can pass the info on which object wasn't set? Thanks

    Read the article

  • iis7 integrated mode asp.net 4.0 forms authentication problem using IE8

    - by FiveTools
    Anyone experience any issues with IIS7, integrated mode forms authentication while using IE8? I have a website with a login form, once logged in, any postback causes the user to be logged out. This doesn't even happen consistently, sometimes I can login and not experience this issue, other times it happens instantly. I can not replicate the problem in any other browser and I cannot replicate on my development machine running / debugging vs2010.

    Read the article

  • ASP.NET MVC editor template for property

    - by Idsa
    Usually I render my forms by @Html.RenderModel, but this time I have a complex rendering logic and I render it manually. I decided to create a editor template for one property. Here is the code (copy pasted from default object editor template implementation): <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% var modelMetadata = ViewData.ModelMetadata; %> <% if (modelMetadata.HideSurroundingHtml) { %> <%= Html.Editor(modelMetadata.PropertyName) %> <% } else { %> <% if (!String.IsNullOrEmpty(Html.Label(modelMetadata.PropertyName).ToHtmlString())) { %> <div class="editor-label"><%= Html.Label(modelMetadata.PropertyName) %></div> <% } %> <div class="editor-field"> <%= Html.Editor(modelMetadata.PropertyName) %> <%= Html.ValidationMessage(modelMetadata.PropertyName) %> </div> <% } %> And here is how I use it: @Html.EditorFor(x => x.SomeProperty, "Property") //"Property" is template above But it didn't work: labels are rendered regardless of DisplayName and editors are not rendered at all (in Watches Html.Editor(modelMetadata.PropertyName shows empty string). What am I doing wrong?

    Read the article

  • Strategy for developing a multi function asp.net web application

    - by user247023
    I'm about to start a new project and want some advice on how to implement. I need a web application which contains a booking module for reserving timeslots, and a time management module which will enable employees to clock in / clock out. If I am writing an update to the time managment module, I don't want to disrupt the booking engine availability by releasing a new solution containing both modules. to make things more difficult, there is some shared functionality like common users, roles and security. Here's a suggestion I've gotten, which sounds a bit cruddy, but may be functional. Write a 'container' web application which consists of basically a frame, and authentication / security features. This then has links which, will load the 2 independantly built and released web applications into the frame. I can see that say, if I wanted to update the time management module, I would only need to build and release this separately, and the rest of the solution would be 'untouched' Any better alternatives?

    Read the article

  • ASP.Net URL rewirting and redirecting....

    - by DDiVita
    I am trying to wrap my head around a URL rewrtie / redirect project I need to work on. We currently have this url: www.domain.com/Details/Detail.aspx?param1=8&param2=12345 Here is what the rewritten URL will look like: www.domain.com/Param1/8/Param2/12345 I am using the ISAPI_Rewrite filter to allow for the "nice" url and make the page think it is still using the old url. That works fine. Now, I need to redirect users, if they use the old URL, to the new URL. I fgiure I would need to use a combination of the filter and an HTTPModule / Handler to perfomr the redirect. Any ideas?

    Read the article

  • ASP.NET MVC: View does not get rendered with updated model value

    - by Newton
    I'm experiencing the a challenge in populating the child records. My previous code was like - <%= Html.TextBox("DyeOrder.Summary[" + i + "].Ratio", Model.DyeOrder.Summary[i].Ratio.ToString("#0.00"), ratioProperties) %> This code does not render the updated values after post back. To resolve this issue my work around was like - <%= "<input id='DyeOrder_Summary_" + i + "__Ratio' name='DyeOrder.Summary[" + i + "].Ratio' value='" + Model.DyeOrder.Summary[i].Ratio.ToString("#0.00") + "' " + ratioCss + " type='text' />"%> This is very clumsy to me. Is there any better ideas...

    Read the article

  • Best Practice to write Connection string for heavy traffic ASP.NET Web Application

    - by hungrycoder
    What is the best way to define connection string for a web application that has minimum 500 live users on the internet in terms of connection pooling. And load factors to consider? Suppose I have connection string as follows: initial catalog=Northwind; Min Pool Size=20;Max Pool Size=500; data source=localhost; Connection Timeout=30; Integrated security=sspi" as Max Pool Size is 500 and as live users exceed 500 say 520 will the remaining 20 users experience slower page load?? Or what if I have connection string as follows which doesn't talks anything about pooling or Connection time out? How the application behaves then? initial catalog=Northwind; data source=localhost; Integrated security=sspi" I'm using "Using statements" however to access the MYSQL database.

    Read the article

  • asp.net web service OneWay definition not working

    - by jbrook10
    When I specify <SoapDocumentMethod(OneWay:=True)> on my webservice it doesn't seem to get called. If I remove that the webservice works properly. Also, everything works fine on the development machine just not on the server. Here is my web method: <SoapDocumentMethod(OneWay:=True)> _ <WebMethod()> _ Public Sub Write(ByVal processGroupId As Integer) xslClass.xslHelper.writeDatabase(processGroupId) ', processGroupName) End Sub Here is my calling code: Dim svc As New svcWriteFiles.WriteDatabaseService svc.WriteAsync(e.CommandArgument) Any ideas?

    Read the article

  • Getting value from a texbox in asp.net

    - by user279521
    Hi, I have a web page which contains multiple panels (used to show and hide various textboxes) and one particular panel contains textboxes that is used to edit records. However, when I am attemtping to update the table, the txtVendorID.Text.Trim() is blank. SqlConnection con = new SqlConnection(strConn); string sqlUpdateVendor = "usp_Vendor_Update"; SqlCommand cmdUpdateVendor = new SqlCommand(sqlUpdateVendor, con); cmdUpdateVendor.CommandType = CommandType.StoredProcedure; cmdUpdateVendor.Parameters.Add(new SqlParameter("@RecID", SqlDbType.VarChar, 50)); cmdUpdateVendor.Parameters["@RecID"].Value = Request.QueryString["Rec_ID"]; cmdUpdateVendor.Parameters.Add(new SqlParameter("@empid", SqlDbType.VarChar, 11)); cmdUpdateVendor.Parameters["@empid"].Value = txtEmpIDNumber.Text.Trim(); cmdUpdateVendor.Parameters.Add(new SqlParameter("@VendorName", SqlDbType.VarChar, 100)); cmdUpdateVendor.Parameters["@VendorName"].Value = txtVendorName.Text.Trim(); Any idea why the textbox does not contain a value?

    Read the article

  • Unit testing a controller in ASP.NET MVC 3

    - by Abdullah Al- Mansur
    public Double Invert(Double? id) { return (Double)(id / id); } I have done this for this test but fails please can anyone help with this cos just started with unit testing /* HINT: Remember that you are passing Invert an *integer* so * the value of 1 / input is calculated using integer arithmetic. * */ //Arrange var controller = new UrlParameterController(); int input = 7; Double expected = 0.143d; Double marginOfError = 0.001d; //Act var result = controller.Invert(input); //Assert Assert.AreEqual(expected, result, marginOfError); /* NOTE This time we use a different Assert.AreEqual() method, which * checks whether or not two Double values are within a specified * distance of one another. This is a good way to deal with rounding * errors from floating point arithmetic. Without the marginOfError * parameter the assertion fails. * */

    Read the article

  • Creating Reports in ASP.NET

    - by Norbs
    I have a crystal report in my application and it works fine but I want to ask if there's a way that the user can manipulate the report that he/she wants? For example, the user wants to create his/her own report. in my application, there are already reports available. They just need to click the link and it will show immediately the specific report. What if the user wants to create his/her own report? Is it possible???

    Read the article

  • ASP .NET - What's going on behind an Eval() ?

    - by Amokrane
    Hi, I'm trying to understand how Eval() works for a specific purpose. I'm working on a project I don't really know and I need to read some data and put them in drop down list. These data are already read and are displayed inside an ItemTemplate. I noticed there are read using the Eval() method. Something like: <ItemTemplate> <a href="...=<%# Eval("foo") %>></a> </ItemTemplate> I need to know where Eval is getting these data from in order to discover where I should read them for my drop down list! But I didn't really understand how it works! I know that Eval() evaluates data binding expressions at runtime but where do you think I should take a look at? Thank you

    Read the article

  • Saving ntext data from SQL Server to file directory using asp

    - by April
    A variety of files (pdf, images, etc.) are stored in a ntext field on a MS SQL Server. I am not sure what type is in this field, other than it shows question marks and undefined characters, I am assuming they are binary type. The script is supposed to iterate through the rows and extract and save these files to a temp directory. "filename" and "contenttype" are given, and "data" is whatever is in the ntext field. I have tried several solutions: 1) data.SaveToFile "/temp/"&filename, 2 Error: Object required: '????????????????????' ??? 2) File.WriteAllBytes "/temp/"&filename, data Error: Object required: 'File' I have no idea how to import this, or the Server for MapPath. (Cue: what a noob!) 3) Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open BinaryStream.Write data BinaryStream.SaveToFile "C:\temp\" & filename, adSaveCreateOverWrite Error: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. 4) Response.ContentType = contenttype Response.AddHeader "content-disposition","attachment;" & filename Response.BinaryWrite data response.end This works, but the file should be saving to the server instead of popping up save-as dialog. I am not sure if there is a way to save the response to file. Thanks for shedding light on any of these problems!

    Read the article

  • ASP.net web page still displaying cached versions

    - by user279521
    My web page is still displaying a previously cached versions of the page. I have this in the page_load event: Response.Clear(); Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1; Response.CacheControl = "no-cache"; Response.Cache.SetCacheability(HttpCacheability.NoCache); I have this in the Page_Init: protected void Page_Init(object Sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); } Any idea what I might be missing?

    Read the article

  • How to page multiple data sets in ASP.NET MVC

    - by REA_ANDREW
    On a single view I will have three sets of paged data. Which means for each model I will have The Objects The Page Index The Page Size My initial thought was for example: public class PagedModel<T> where T:class { public IList<T> Objects { get; set; } public int ModelPageIndex { get; set; } public int ModelPageSize { get; set; } } Then having a model which is to be supplied to the action as for example: public class TypesViewModel { public PagedModel<ObjectA> Types1 { get; set; } public PagedModel<ObjectB> Typed2 { get; set; } public PagedModel<ObjectC> Types3 { get; set; } } So if I then for example have the Index view inherit from the type: System.Web.Mvc.ViewPage<uk.co.andrewrea.forum.Web.Models.TypesViewModel> Now my initial aciton method for the index is simply: public ActionResult Index() { var forDisplayPurposes = new TypesViewModel(); return View(forDisplayPurposes); } If I then want to page, it is here where I am struggling to decide which action to take. Lets say that I select the next page of the Types2 PageModel. What should the action look like for this in order to return the new view showing the second page of the Types2 PageModel I was thinking possibly to duplicate the action but use it with POST [AcceptVerbs(HttpVerbs.Post)] public ActionResult Index(TypesViewModel model) { return View(model); } Is this a good way to approach it. I understand there is always Session, but I was just wondering how such a thing is achieved currently out there. If any best methods have been mutually accepted and things. So simply, one page with multiple paged models. How to persist the data for each using a wrapper model. Which way should you pass in the model and which way should you page the data, i.e. Form Post Lastly, I have seen the routes take this into account i.e. {controller}/{action}/{id}/{pageindex}/{pagesize} but this only accounts for one model and I do not really wwant to repeat the pagesize and pageindex values for the number of models I have inside the wrapper model. Thanks for your time!! Andrew

    Read the article

  • ASP.NET C# Application Object Getters and Setters

    - by kellax
    I have had a hard time finiding a newbie friendly example of accessing Application Object. I have few things ( arrays ) i would like to store in Application Object to keep as persistant data for about 2h till AppRecycle Anyhow i know how to set an Application Object variable this way: // One way String[] users = new String[1000]; Application["users"] = users; // Another way Application.Add("users", users); However i do not know how to access these variables once in Application Object there is a Getter method Get however it requires int index and other one Contents which get's everything. Here i try to retrive my String[] array but gives me a error that i am trying to convert Object to String. String[] usersTable = Application["users"]; // Since this is an object i also tried Application.users but gives error

    Read the article

  • Need help regarding query string in asp.net

    - by vaibhav
    I have a page create-quote.aspx. I want to open this page in different modes, depending on whether a querystring parameter is present or not. My question is at which event should I check, If I have a querystring parameter or not. I think, it should be preinit, what do you say.

    Read the article

  • Validation error language in asp.NET dynamic data WEB-site

    - by loviji
    Hello, I need to change language of validation error to another language. Validation logic must not be changed. I just want to translate The field f5080eb8_0a83_4b89_b339_233528441711 must be a valid integer. into another language. For example from English into Italian. I search in my project for this text, result=0. So, what is the best way to translate validation error text into another language? Some ideas, thanks!

    Read the article

  • in .net, what programming model would be good for prototyping, but then reusable for production (for

    - by Greg
    Hi, In .NET land what would be a good approach for quick prototyping of a concept (i.e. development just on my PC) that could then be extended out to product (users across LAN/WAN), BUT in a fashion that the model/business logic code and data access layer code can be used as is? One thought for example I had as to do: (a) WinForms with business logic and Entity Framework layer to SQL Server Express on my PC, then (b) Go then to ASP.net (using the business logic / data library) with SQL Server/IIS Any comments? Other suggestions?

    Read the article

< Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >