Search Results

Search found 427 results on 18 pages for 'ascx'.

Page 2/18 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • asp.net mvc create a c# class in an ascx file for design purposes

    - by Julian
    Hi, I am developing a web application using asp.net mvc. I have come across the need to Temporarily create a class in the ascx/aspx file. This class will replace the Model during the development of the page. It will also hold some test data for the user to have the chance to see some results. Once we are happy with the layout on the screen, I will inherit the correct Model class through the Control tag. Can you please advise if this is possible and how to do it? This does not work: <% class Modelo { public Guid Guid { get; set; } public string Name { get; set; } } %> Thanks in advance, Be happy - Julian

    Read the article

  • Render a user control ascx

    - by Jeremy
    I want to use an ascx as a template, and render it programatically, using the resulting html as the return value of an ajax method. Page pageHolder = new Page(); MyUserControl ctlRender = (MyUserControl)pageHolder.LoadControl(typeof(MyUserControl),null); pageHolder.Controls.Add(ctlRender); System.IO.StringWriter swOutput = new System.IO.StringWriter(); HttpContext.Current.Server.Execute(pageHolder, swOutput, false); return swOutput.ToString(); This all executes, and the Page Load event of the user control fires, but the StringWriter is always empty. I've seen similar code to this in other examples, what am I missing?

    Read the article

  • Edit and Create view using EditCreate.ascx partial in ASP.NET MVC

    - by mare
    If you look at the NerdDinner example of creating and editing dinners then you see they use a partial (ViewUserControl or ASCX) DinnerForm to put the functionality of creating and editing dinners into one file because it is essential the same and they use it using RenderPartial("DinnerForm"). This approach seems fine for me but I've run into a problem where you have to add additonal route values or html properties to the Form tag. This picks up the current action and controller automatically: <% using (Html.BeginForm()) { %> However, if I use another BeginForm() overload which allows to pass in enctype or any other attribute I have to do it like this: <% using ("Create", "Section", new { modal = true }, FormMethod.Post, new { enctype = "multipart/form-data" })) and as you can see we lose the ability to automatically detect in which View we are calling RenderPartial("OurCreateEditFormPartial"). We can't have hardcoded values in there because in Edit View this postback will fail or won't postback to the right controller action. What should I do in this case?

    Read the article

  • ID not recognized in .ascx page

    - by Alexander
    I have the following code: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DurationPicker.ascx.cs" Inherits="Permias.DurationPicker" %> <%@ Register TagPrefix="Club" Namespace="ClubSite" %> <div class="controlblock"> <table> <tr> <td> Start Date: </td> <td> <Club:DatePicker ID="dp1" runat="server" /> </td> <td> <Club:TimePicker ID="tp1" runat="server" /> </td> </tr> <tr> <td> End Date: </td> <td> <Club:DatePicker ID="dp2" runat="server" /> </td> <td> <Club:TimePicker ID="tp2" runat="server" /> </td> </tr> </table> </div> In my code behind I have public System.DateTime startDateTime { get { return dp1.SelectedDate.Add(tp1.SelectedTime.TimeOfDay); } set { dp1.SelectedDate = value; tp1.SelectedTime = value; } } However dp1 is underlined in red, which means it can't find dp1.. why is this?

    Read the article

  • client side validation in ascx files (user controls) for asp.net mvc

    - by Sefer KILIÇ
    hi, I have a logOn forn in ascx files and I render it as partial. How I can add a clinet side validation to this form, have any idea ? My below code does not work <%= Html.ValidationSummary(true, "Giris basarisiz oldu. Lütfen hatalari düzeltip tekrar deneyin.") %> <% Html.EnableClientValidation(); %> <% using (Html.BeginForm("LogOnProcess", "Account")) { %> <div> <fieldset> <legend>Hesap Bilgileri</legend> <div class="editor-label"> <%= Html.LabelFor(m => m.UserName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(m => m.UserName) %> <%= Html.ValidationMessageFor(m => m.UserName) %> </div> <div class="editor-label"> <%= Html.LabelFor(m => m.Password) %> </div> <div class="editor-field"> <%= Html.PasswordFor(m => m.Password) %> <%= Html.ValidationMessageFor(m => m.Password) %> </div> <div class="editor-label"> <%= Html.CheckBoxFor(m => m.RememberMe) %> <%= Html.LabelFor(m => m.RememberMe) %> </div> <p> <input type="submit" value="Giris" /> </p> </fieldset> </div> <% } %>

    Read the article

  • problems with user control page

    - by Alexander
    I am starting to give up troubleshooting this issue I had... I had an .ascx page and had the following user control in it: <td> <Club:DatePicker ID="dp1" runat="server" /> </td> however in my code behind when I tried to write methods: public System.DateTime startDateTime { get { return dp1.SelectedDate.Add(tp1.SelectedTime.TimeOfDay); } set { dp1.SelectedDate = value; tp1.SelectedTime = value; } } It can't reference dp1(dp1 is underlined in red) as well as tp1... why is this?? I've tried to convert the solution to a web application and yet it doesn't work. Tried adding: protected global::ClubSite dp1; protected global::ClubSite tp1; in the ascx.designer.cs but then the global is highlighted in red here's the link to my full solution: http://cid-1bd707a1bb687294.skydrive.live.com/self.aspx/.Public/Permias.zip

    Read the article

  • How do I associate the Enter key with a button on an aspx page?

    - by Xaisoft
    I have an asp.net ascx control file and I have put the control on an aspx page. The aspx page has a button in which when I press enter on the keyboard, I want it to fire the event handler for the button. Is there a way to set this? I am using a master page with a button already on it, so now when I press the enter key, the event handler for that button fires.

    Read the article

  • Is it possible to modify ASP.NET to no longer require runat="server"?

    - by sean2078
    I know why runat="server" is currently required (ASP.NET why runat="server"), but the consensus is that it should not be required if you incorporate a simple default into the design (I agree of course). Would it be possible to modify, extend, decompile and recreate, intercept or otherwise change the behavior of how ASP.NET parses ASPX and ASCX files so that runat="server" would no longer be required? For instance, I assume that a version of Mono could be branched to accomplish this goal. In case specific requirements are helpful, the following highlights one design: During parsing, when configured namespace tags are encountered (such as "asp"), default the element's runat property to "server" During parsing, when configured namespace tags are encountered (such as "asp"), if the element's runat property value is available, then that value should be used in place of the default New page-level setting introduced (can be set in the page directive or web.config) that specifies the default runat value for a specific namespace tag

    Read the article

  • Usercontrol losing Viewstate across Postback

    - by Robert W
    I have a user control which uses objects as inner properties (some code is below). I am having trouble with setting the attribute of the Step class programmatically, when set programmatically it is being lost across postback which would indicate something to do with Viewstate (?). When setting the property of the Step class declaratively it's working fine. Does anybody have any ideas of what this code be/what's causing it to lose the state across postback? public partial class StepControl : System.Web.UI.UserControl { [PersistenceMode(PersistenceMode.InnerProperty)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [NotifyParentProperty(true)] public Step Step1 { get; set; } [PersistenceMode(PersistenceMode.InnerProperty)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [NotifyParentProperty(true)] public Step Step2 { get; set; } protected void Page_Init(object sender, EventArgs e) { AddSteps(); } private void AddSteps() { } } [Serializable()] [ParseChildren(true)] [PersistChildren(false)] public class Step { [PersistenceMode(PersistenceMode.Attribute)] public string Title { get; set; } [PersistenceMode(PersistenceMode.Attribute)] public string Status { get; set; } [PersistenceMode(PersistenceMode.InnerProperty)] [TemplateInstance(TemplateInstance.Single)] [TemplateContainer(typeof(StepContentContainer))] public ITemplate Content { get; set; } public class StepContentContainer : Control, INamingContainer { } }

    Read the article

  • Graphical designer for asp.net controls.

    - by truthseeker
    Hi, I'm searching a graphical designer, better than visual studio designer for asp.net typical and ajax controls. Visual studio designer (VS 2010 B2) very often don't handle with html code and shows nothing. Is there any better tool for writing code behind and design graphically controls for asp.net web sites?

    Read the article

  • Page_load filling data after loading UserControl ASP.net

    - by msytNadeem
    I have an aspx Page that contain a userControl that contains textboxes. in the page_load method, it reads from the database, and i want to fill the textboxes of the usercontrol with the data been read. the problem i am facing, that the flow of page loading is Page_Load of the page, where i am assigning the text field, then it page_load of the userControl, so here all the data will be erased, then it will show the page. how i can fix this.

    Read the article

  • How can I pass data from an aspx page to an ascx modal popup?

    - by Erick B
    I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar. I have an aspx page that contains a grid of checkboxes. I have a button that is coded via a Button_Click event to collect a list of which rows are checked and create a session variable out of that list. The same button is referenced (via TargetControlID) by my ascx page's ModalPopupExtender which controls the panel on the ascx page. When the button is clicked, the modal popup opens but the Button_Click event is never fired, so the modal doesn't get its session data. Since the two pages are separate, I can't call the ModalPopupExtender from the aspx.cs code, I can't reach the list of checkboxes from the ascx.cs code, and I don't see a way to populate my session variable and then programmatically activate some other hidden button or control which will then open my modal popup. Any thoughts?

    Read the article

  • Whats the best way of using MVC + ajax (jquery) to load page content, aspx or ascx or both

    - by devzero
    I want to have a menu that when I click replaces the content of a "main" div with content from a mvc view. This works just fine if I use a .aspx page, but any master.page content is then doubled (like the and any css/js). If I do the same but uses a .ascx user control the content is loaded without the extras, but if any browser loads the menu item directly (ie search bot's or someone with JS disabled), the page is displayed without the master.page content. The best solution I've found so far is to create the content as a .ascx page, then have a .aspx page load this if it's called directly from the menu link, while the ajax javascript would modify the link to use only the .ascx. This leads to a lot duplication though, as every user control needs it's own .aspx page. I was wondering if there is any better way of doing this? Could for example the master.page hide everything that's not from the .aspx page if it was called with parameter ?ajax=true?

    Read the article

  • How do I load ascx pages faster in visual studio 2008?

    - by diadem
    One of my (my team's) biggest peeves with VS2008 is the slow speed in which ascx load. It could take up to a couple minutes to do something as simple as a text or style change simply because of the time it takes to load an ascx page into the visual studio text editor. Half the time I'm tempted to check out the file, edit it in notepad, then check it back in. Is there any trick to speeding this up?

    Read the article

  • How to customize web-app (pages and UI) for different customers

    - by demoncodemonkey
    We have an ASP.NET web-application which has become difficult to maintain, and I'm looking for ideas on how to redesign it. It's an employee administration system which can be highly customized for each of our customers. Let me explain how it works now: On the default page we have a menu where a user can select a task, such as Create Employee or View Timesheet. I'll use Create Employee as an example. When a user selects Create Employee from the menu, an ASPX page is loaded which contains a dynamically loaded usercontrol for the selected menuitem, e.g. for Create Employee this would be AddEmployee.ascx If the user clicks Save on the control, it navigates to the default page. Some menuitems involve multiple steps, so if the user clicks Next on a multi-step flow then it will navigate to the next page in the flow, and so on until it reaches the final step, where clicking Save navigates to the default page. Some customers may require an extra step in the Create Employee flow (e.g. SecurityClearance.ascx) but others may not. Different customers may use the same ASCX usercontrol, so in the AddEmployee.OnInit we can customize the fields for that customer, i.e. making certain fields hidden or readonly or mandatory. The following things are customizable per customer: Menu items Steps in each flow (ascx control names) Hidden fields in each ascx Mandatory fields in each ascx Rules relating to each ascx, which allows certain logic to be used in the code for that customer The customizations are held in a huge XML file per customer, which could be 7500 lines long. Is there any framework or rules-engine that we could use to customize our application in this way? How do other applications manage customizations per customer?

    Read the article

  • passing id to controller

    - by coure06
    I have 4-5 partial view files (.ascx) like abc.ascx, cde.ascx, fgh.ascx. I want to return different partial views based on the name of the view passed to url parameter like this /someservice/abc will go to action someservice and will return abc.ascx partial view. /someservice/cde will go to action someservice and will return cde.ascx partial view. How can achieve this?

    Read the article

  • Is the structure used for these web pages a design pattern?

    - by aspdotnetuser
    I want to know if the structure for an ASP.NET website I'm working on uses a design pattern for it's web pages. If it is a design pattern, what is it called? The web pages have the following structure: UserDetails page (UserDetails.aspx) - includes UserDetailsController.ascx user control. UserDetailsController.ascx includes sub user controls like UserAccountDetails.ascx and UserLoginDetails.ascx etc Each sub user control contains a small amount of code/logic, the 'controller' user controls that host these sub user controls (i.e UserDetailsController.ascx) appear to call the business rules code and pass the data to the sub user controls. Is this a design pattern? What is it called?

    Read the article

  • Adding a reference to a css file in an ascx file in vs2008 only to get intellisense

    - by Nick Allen - Tungle139
    Normally visual studio brings up intellisense for available css classes, which it draws from css files linked to the current aspx/master document. Is there a way to get this to work in an ascx file in a similar way to referencing external JavaScript files in js files for the purpose of intellisense /// <reference path="jquery-1.4.1.js" /> I only want this for the purpose of intellisense and not getting squiggly lines under un-recognised classes. My css files will be actually linked from the aspx/master page.

    Read the article

  • Difference between `<%#` and `<%=` and an asp.net ascx file?

    - by jax
    I understand that <%= is for returning a String I seem to usually use <%# in my .ascx files. For example the following works OnClientClick=<%# String.Format("return confirm('Are you sure you wish to delete barcode ({0})?');", Eval("BARCODE") ) %> The following does not work OnClientClick=<%# String.Format("return confirm('Are you sure you wish to delete barcode ({0})?');", Eval("BARCODE") ) %>

    Read the article

  • Visual Studio 2008 hangs while opening aspx/ascx file.

    - by rafek
    Hi all! I've issue with VS08. I've got Web Application project (vb.net). Whenever I try to open an aspx or ascx (in Source view - just double clicking on Solution Explorer) the file opens, but VS hangs and is not responding. The only way to restart VS is then by killing it's process. And it happens all the time with these types of files. :/ Reinstall didn't work. In addition, the only plugin I've installed with this instance of VS is ClearCase source control plugin.

    Read the article

  • Difference between these two ways of localizing a string in an aspx/ascx file?

    - by Brandon
    When I started localizing a website the first time, I just did the localization like this: <%= Resources.ResourceFile.ResourceName %> and it seems to work perfectly fine. However, the ReSharper 5.0 Beta does it like this: <asp:Localize Text="<%$ Resources: ResourceFile, ResourceName %>" runat="server"> Value </asp:Localize> Does it matter which way it gets done? If it doesn't matter, is there any way to make ReSharper do it the way I'm doing it? I kind of prefer it this way since it is less text in the aspx/ascx files.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >