Search Results

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

Page 11/18 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • FxCop CA2000 Warning in UserControls

    - by esjr
    Running FxCop on a WebProject that contains a UserControl will result in a CA2000 Warning (Call System.IDisposable.Dispose on object) for every ServerControl (Label, TextBox,...) in that UserControl. I understand why this would happen. Replacing the 'offending' ServerControls with a PlaceHolder and then adding the Controls in code (Using...End Using) might be a way around that, but it is not always an option.But, if they are not 'kosher' why have ServerControls you can drop in your ascx/aspx in the first place ?Am I missing something ? If, like in my case, you inherit a sizeable collection of fairly complex UserControls, do I now add every 'offending' Control to the GlobalSupperssions file (that's a lot of mind numbing right-clicking) ?I do not want to suppress all CA2000 warnings since it makes perfect sense to fix them, but not in the case of ServerControls in UserControls.

    Read the article

  • Dynamic controls lost when postback

    - by Joren
    Hi I load my self-made webuser controls dynamically. A user chooses a template and depending on that template I load some self-made webuser controls (.ascx) that are defined in a sql server database. When the user fills in the TextBoxes and clicks on the submit button, the entries in the TextBoxes should be saved in my database. The problem is that when clicking the submit button, the TextBox entries are erased. I searched a lot to fix this problem, for example I tried to load every control again every postback by putting the code in the Page_Init event but unfortunately it won't work.

    Read the article

  • asp:FileUpload not working in UpdatePanel

    - by James123
    asp:FileUpload control is not working in update panel in ascx control. Why? any work around. <span dir="ltr"> <asp:FileUpload ID="InputFile" runat="server" class="ms-fileinput" size="35" /> </span> and also I added <Triggers> <asp:PostBackTrigger ControlID="btnOK" /> </Triggers> Still it is not working.

    Read the article

  • autopostback problem listbox asp.net

    - by lodun
    I want to add posts(question) like i do that on yahoo answers.When i choose item in "kategorije" control,items can't be loaded in "SUB_kategorije" control. Image My new ascx.cs: 1. protected void Page_Load(object sender, EventArgs e) 2. { 3. 4. 5. if (!Page.IsPostBack) 6. { 7. 8. SqlDataSource ds = new SqlDataSource(); 9. ds.ConnectionString = conn; 10. ds.SelectCommand = "SELECT [ID], [Kategorije] FROM [kategorije] "; 11. kategorije.DataSource = ds; 12. kategorije.DataTextField = "Kategorije"; 13. kategorije.DataValueField = "ID"; 14. kategorije.DataBind(); 15. kategorije.SelectedIndex = 1; 16. 17. SqlDataSource dk = new SqlDataSource(); 18. dk.ConnectionString = conn; 19. dk.SelectCommand = "SELECT * from pod_kategorije WHERE kat_id = " + kategorije.SelectedItem.Value; 20. SUB_kategorije.DataSource = dk; 21. SUB_kategorije.DataTextField = "pkategorija"; 22. SUB_kategorije.DataValueField = "ID"; 23. SUB_kategorije.DataBind(); 24. 25. 26. } 27. 28. 29. 30. 31. } 32. protected void kategorije_SelectedIndexChanged(object sender, EventArgs e) 33. { 34. 35. 36. SqlDataSource dk = new SqlDataSource(); 37. dk.ConnectionString = conn; 38. dk.SelectCommand = "SELECT * from pod_kategorije WHERE [kat_id] = " + kategorije.SelectedItem.Value; 39. SUB_kategorije.DataSource = dk; 40. SUB_kategorije.DataTextField = "pkategorija"; 41. SUB_kategorije.DataValueField = "ID"; 42. SUB_kategorije.DataBind(); 43. 44. 45. } and .ascx: 1. <asp:ListBox ID="kategorije" runat="server" Height="380px" CssClass="kat" AutoPostBack="true" 2. 3. onselectedindexchanged="kategorije_SelectedIndexChanged"></asp:ListBox> 4. 5. <asp:Button ID="Button1" CssClass="posalji" runat="server" Text="click" 6. onclick="Button1_Click" /> 7. 8. 9. 10. <asp:UpdatePanel ID="UpdatePanel10" runat="server"> 11. <ContentTemplate> <asp:ListBox ID="SUB_kategorije" CssClass="pod" Height="150px" runat="server"></asp:ListBox></ContentTemplate> 12. <Triggers> 13. <asp:AsyncPostBackTrigger ControlID="kategorije" EventName="SelectedIndexChanged" /> 14. 15. </Triggers> 16. 17. </asp:UpdatePanel>

    Read the article

  • How to Add Css style sheet on DevExpress Gridview?

    - by Phsika
    i have big problem about CssFilePath property in ASPXGridView . also used Theme Deployer. i created ASPXGRidView that is goog in 9.3.4 version not problem is occured but i upgrated my system to 2010.2 version (Last version) but GridView CssFilePath not working my GridView looks html table. How can i solve it : i converted my project devexpress 9.3.4 to 2010.2 but My Working gridView look like this:TEST.ASCX has got a DevExpress GridView. <Styles CssFilePath="../../App_Themes/Aqua/GridView/styles.css" CssPostfix="Aqua"></Styles> i see asp.net design mode Aqua mode every thing ok. But press f5 my Gridview look above! how can i see aqua style...

    Read the article

  • ASP.NET Error when referencing a code-behind variable

    - by mattgcon
    I have an aspx page that is supposed to reference a code-behind variable but I am receiving an error of "The name [variable] does not exist in the current context" Here is the aspx code <%@ Control Language="C#" AutoEventWireup="true" Inherits="IPAM.Website.Controls.controls_event_header" Codebehind="event_header.ascx.cs" %> <%# strEventLink %> <h3><%# strEventDate %></h3> <%# strLinks %> Here is part of the aspx.cs code declaring those variables: public string strEventLink = ""; public string strEventDate; public string strLinks = ""; Here is the part of the aspx.cs code where it sets those variables: strEventLink = "<h2>" + parent.Name + "</h2>"; strLinks += "<p><font size=\"+1\"><a href=\"" + Page.ResolveUrl("~" + strScheduleLink) + "\"><b>" + strScheduleLinkText + "</b></a></font></p>\n"; strEventDate = ei.DateSpan; Please help me with this problem

    Read the article

  • Html.ActionLink in Partial View

    - by olst
    Hi. I am using the following code in my master page: <% Html.RenderAction("RecentArticles","Article"); %> where the RecentArticles Action (in ArticleController) is : [ChildActionOnly] public ActionResult RecentArticles() { var viewData = articleRepository.GetRecentArticles(3); return PartialView(viewData); } and the code in my RecentArticles.ascx partial view : <li class="title"><span><%= Html.ActionLink(article.Title, "ViewArticle", new { controller = "Article", id = article.ArticleID, path = article.Path })%></span></li> The problem is that all the links of the articles (which is built in the partial view) lead to the same url- "~/Article/ViewArticle" . I want each title link to lead to the specific article with the parameters like I'm setting in the partial view. Thanks.

    Read the article

  • Javascript performance issue

    - by Daniel
    Hello, I've built a top menu based on superfish, but the amount of displayed items in the menu is huge. And there is also alot of jquery on the top menu. Now to the problem, everytime I load any page that has the menu, the browser(ie7) feels like it looks it locks it self for about 1-2 seconds while the page is being loaded. I'm sure that the top menu is the issue, and I would like to improve the performance of the page.(besides removing the menu and removing the menu items) I've used firebug to see which calls take most of the times, and I the calls are standard jquery or superfish. The top menu is a ascx control. Are they any good ways to let the page load first and the menu later or any other goods ideas to improve the performance?

    Read the article

  • Formatting address of different types

    - by mickyjtwin
    I have various classes which all contain address details, i.e. AddressLine1, AddressLine2, AddressLine3, Suburb, Town, etc. On the front end, I need to format the address in a particular way, i.e. AddressLine1<br /> AddressLine2<br /> Suburb State Postcode If AddressLine2 does not exist or empty, don't show it. Quite straight-forward. I am trying to determine the best way to show this info. At the moment, the Address property of each class calls a FormatAddress method which writes out the html string. This exists as a method of the class. My opinion is that any formatting should exist from the front-end control i.e. ascx etc. However, if these DetailClasses need to format the same address info, what would be the best option, also making it easier to maintain?

    Read the article

  • Tool to convert inline C# into a code behind file

    - by Jon Jones
    Hi I have a number of legacy web controls (ascx) that contains huge amounts of inline C#. The forms contain a number of repeated and duplicate code. Our first plan is to move the code into code behinds per file, then refactor etc... were doing this to upgrade the client to the latest version of their cms At the moment we are going to have to manually copy and paste from hundreds of files, create a code behind, copy the code, add the namespaces based on the client-side imports and then do any tidying up does anybody PLEASE know of a tool that can do the majority of this work for us ? Thanks

    Read the article

  • Get clientid in user control from external javascript file

    - by Giorgi
    Hello, I am developing a user control (ascx) in ASP.NET which uses javascript for manipulating controls. Currently the javascript code is inlined and uses <%= somecontrol.ClientID %> to get the control it needs. I want to put the javascript file in external file but from external file I cannot use the above syntax for retrieving controls. I have read about possible solutions in this and this answers but the problem is that the user control can be placed multiple times on page. This means that the Controls array (mentioned in the answers) will be rendered several times with different items. As a result the script will not be able to retrieve the id it needs. If I put <%= ClientId %> in the name of array that holds items then I will have the same problem as I am trying to solve. Any ideas?

    Read the article

  • Using Server side method from Javascript without AJAX

    - by Aswin Ramakrishnan
    I have a tricky problem. I am in a situation where I need to use a method defined in a .cs file from a javascript function. The problem is we are using .NET 1.1 and AJAX cannot be used for the application. Also, I will need to pass a string from the javascript to the server side method. The page where I am implementing the javascript is a .as Any ideas? I have tried doing a post back and creating a RaisePostBack event handler method (both in the .aspx page and the .ascx user control) but no luck. It will be greatly appreciated if someone could help me out with the problem.

    Read the article

  • Is there any latest YAFForum OpenSource?

    - by user306905
    Hi, All I downloaded YAF-v1.9.4-RC1-BIN.zip version. but it is not working . and also added tagprefix in the web.config file. <add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls, Version=1.9.4.0" /> but still some errors occured. like sandbox related. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ShoutBox.ascx.cs" Inherits="YAF.Controls.ShoutBox" % Is there any conplete solution . please send me [email protected] .

    Read the article

  • Dynamic adding of usercontrols not showing control on page

    - by Phil
    I am trying to insert a user control dynamically into my default.aspx page via the following method in the page_init: Dim control As UserControl = LoadControl("~\Modules\Content.ascx") Controls.Add(control) When I run the page there is no sign of the usercontrol. Am I using the correct code to insert the usercontrol? Is there an alternative method of insertion available? Does the fact that the usercontrol has a page_load make a difference? Do I need to register the control in my aspx page at design time? Thanks in advance for any assistance you can offer.

    Read the article

  • Google map in user control not loading from aspx code behind

    - by poojad
    I am using Google maps API for proximity search. I have all this in an ascx client side. I have a button in the aspx code behind. The initial load of the map is fine. But on the button click, the map is not being loaded though all the other controls are loading properly. The controls are in an Update Panel and I am new to using these. Would appreciate in any suggestions made.

    Read the article

  • Adding a custom control to a page, then adding multiple custom children into that one, null user con

    - by Rickjaah
    Hello all, While nerding my way through the day again. I came across a problem concerning adding children to an already add child control. I can add the controls, but when trying to use the controls in the added control, they all return null. This is the method: protected override CreateChildControls(EventArgs e) { UserControl uControl = LoadControl("~/controls/TwoColumn.ascx"); PlaceHolder holder = uControl.Controls.FindControl(phrContentMiddle) as PlaceHolder; holder.Controls.Add(LoadControl("~/controls/ImageShowControl"); } When i try to call any type of button/UserControl inside the ImageShowControl.... All return null. Is this something in the Page LifeCycle? If so, what is the way to go to realize this?

    Read the article

  • What is your favorite convention for organizing a ASP.NET project?

    - by Michael Rosario
    Hello world. My team is starting a brand new ASP.NET solution which will probably become large. Inspired by ASP.NET MVC, we currently express all data access objects in a model project. We, however, do not have good conventions for organizing ASP.NET ascx's and aspx's. We have already reviewed DotNetNuke and want to avoid the complexity of driving the whole application through a single default.aspx . What is the best way to organize a non-MVC ASP.NET solution? Your tips, links, and advice are greatly appreciated!

    Read the article

  • Limit JavaScript and CSS files on ASP.NET MVC 2 Master Page based on Model and View content

    - by Zack Peterson
    I want to include certain .js and .css files only on pages that need them. For example, my EditorTemplate DateTime.ascx needs files anytimec.js and anytimec.css. That template is applied whenever I use either the EditorFor or EditorForModel helper methods in a view for a model with a DateTime type value. I've put this condition into the <head> section of my master page. It checks for a DateTime type property in the ModelMetadata. <% if (this.ViewData.ModelMetadata.Properties.Any(p => p.ModelType == typeof(DateTime))) { %> <link href="../../Content/anytimec.css" rel="stylesheet" type="text/css" /> <script src="../../Scripts/anytimec.js" type="text/javascript"></script> <% } %> This has two problems: Fails if I have nested child models of type DateTime Unnecessarily triggered by views without EditorFor or EditorForModel methods (example: DisplayForModel) How can I improve this technique?

    Read the article

  • ASP.NET MVC: Routing

    - by JamesBrownIsDead
    Let's say I have this Controller: public class GlobalizationController : Controller { public JavaScriptResult GlobalizedLabels(string virtualPath) { return new JavaScriptResult(); } } I want the controller to handle (i.e. invoke from) any of the relative URLs below: /globalization/~Enlargement/Controls/Container.ascx /globalization/test/foobar.aspx /globalization/HappyTimes/Are/Right/Now What would my entry in global.asax routes.MapRoute() entry look like? As in... routes.MapRoute("Globalization", "globalization/{virtualPath}", new { controller = "Globalization", action = "GlobalizedLabels" }); The URL pattern "{virtualPath}" is wrong. What should it be?

    Read the article

  • Compilation error on a user control

    - by MikeP
    I'm stumped! We have a user control for managing account information. We use this particular control on two pages. On one page, everything works perfectly and meets our expectation. On the second page however we receive compilation errors stating that: "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\lrpcentral\0e987bea\6719c8b6\App_Web_PageThatFails.aspx.f3d462c1.oi52bvii.0.cs(172): error CS0433: The type 'xxxx_ascx' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\APPLICATIONNAME\0e987bea\6719c8b6\App_Web_xxxx.ascx.cdcab7d2.xbnvt2za.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\APPLICATIONNAME\0e987bea\6719c8b6\App_Web_eix7xllr.dll' My problem is similar to Cyril's but the "delete everything from Temp" is not an option for me, and Cyril's solution does not apply since the only variable we have is contained in the designer file, which is not deployed to our production environment (we pre-compile). After reading David's answer (here) I examined my directories for circular dependency and was unable to find any. Structure: Top Level Page that works Control Directory A Page that causes the error

    Read the article

  • How do I use master page container in partial view

    - by user200295
    I have several partial views with Javascript that I am trying to move to the bottom of the page. To do this I am trying to use a container in the master page Master Page - <asp:ContentPlaceHolder ID="Foot" runat="server"></asp:ContentPlaceHolder> Partial view(ascx) <asp:Content ID="header" ContentPlaceHolderID="head" runat="server"> ... </asp:Content> But I get this error Parser Error Message: Content controls have to be top-level controls in a content page or a nested master page that references a master page. So how do I ensure that the Javascript for the partial view is at the bottom of the page? Especially in cases where the html layout needs to be at the top of the page?

    Read the article

  • calling a method on the parent page from a user control

    - by Kyle
    I am using a user control that I created (just a .cs file not an .ascx file), that does some magic and depending on a value generated by the control, I need it to do something on the parent page that is 'hosting' the control. It needs to call a method under certain circumstances (method is on the parent control). the control is placed on the parent page like so: <customtag:MyControl ID="something" runat="server" /> I'm dynamically creating buttons etc on the control itself but when a button is clicked, let's say for example that there's a text box on the control and if the value of the textbox is "bob" it needs to call a method on the page that's housing the control...how can I accomplish this?

    Read the article

  • Starting with asp.net MVC

    - by Josemalive
    Hello, Actually im doing a home page that only have an action called Index() that returns the view Index.ascx. This index page will be composed by lastest news and lastest registered users, i think that create two partial views is the best idea (this way i could use it in other views). for other hand i have a data access class that calls to database for get stuff (get last news, get last users, etc...) My question is simple, should i call to the this data access class in the Index() action of my HomeController, and add to the ViewData the data obtained? I think that this index() action shouldnt be the responsable of passing this data to the partial views, right? Could you give me a hand? im messing too much? ;-) Thanks in advance. Best Regards. Jose

    Read the article

  • Why does ASP.Net rewrite relative paths for runat=server anchor controls?

    - by Atomiton
    I have my UserControls in a ~/Controls folder in my solution: /Controls/TheControl.ascx If specify the following: <a runat="server" href="./?pg=1">link text</a> ASP.Net seems to want to rewrite the path to point to the absolute location. For example, If the control is on site.com/products/fish/cans.aspx the link href will be rewritten to read <a href="../../Controls/?pg=1>link text</a> Why does Asp.Net rewrite these control paths, and is there an elegant way to fix it? I just want the anchor control to spit out exactly what I tell it to!!! Is that so hard?

    Read the article

  • Too many JavaScript and CSS files on my ASP.NET MVC 2 Master Page?

    - by Zack Peterson
    I'm using an EditorTemplate DateTime.ascx in my ASP.NET MVC 2 project. <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %> <%: Html.TextBox(String.Empty, Model.ToString("M/dd/yyyy h:mm tt")) %> <script type="text/javascript"> $(function () { $('#<%: ViewData.TemplateInfo.GetFullHtmlFieldId(String.Empty) %>').AnyTime_picker({ format: "%c/%d/%Y %l:%i %p" }); }); </script> This uses the Any+Time™ JavaScript library for jQuery by Andrew M. Andrews III. I've added those library files (anytimec.js and anytimec.css) to the <head> section of my master page. Rather than include these JavaScript and Cascading Style Sheet files on every page of my web site, how can I instead include the .js and .css files only on pages that need them--pages that edit a DateTime type value?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >