Can you use the new Microsoft Chart Control for .NET Framework inside a usercontrol? Bacause when i take a working chart from my page and then copy it to a usercontrol the picture is blank very weird.
I've a ASP.Net page (Default.aspx) which will load UserControl (ucontrol.ascx) dynamically into an UpdatePanel. By using UpdatePanel, we believe we're able to prevent the entire page to be posted-back.
My problem is, within the UserControl, we have some form controls, such as inputs and buttons; after the UserControl is loaded, clicking on any button inside the UserControl will cause the UpdatePanel to be blanked. During the investigation, I found that, breakpoints within the Button1_Click() in the code-behind for the UserControl is never reached. Please reference to the code below, this references to [REFERENCE]1.
I have a masterpage and inside that masterage is a user control that has a toolbar with a save button. I then have an aspx page that inherits form t he master page. In that page I have and updatepanel. Is it possible to set the post back trigger to the Save button inside the usercontrol?
I use the tabpanel and place it in a usercontrol. but the text in the tab header are cut off when opened in IE6 and IE7. in mozilla this is working properly. i am loading this usercontrol in a webpart so i can add it in any page in my site.
i am doing Fileupload using asp.net 3.5 with asp.net ajax.In that i am using Usercontrol MainPage.ascx Page:In this page i am using UpdatePanel inside Fileupload control. Demo.aspx:In this page also i am using Updatepanel. i am drag MainPage.ascx usercontrol inside this UpdatePanel which is in Demo.aspx. Question: When i drag the Mainpage.ascx Usercontrol on Demo.aspx. Here i am getting the Fileupload.HasFile is getting null .If anybody knows Plz.
there's a label control on my master page..if its value is "Value1" ,I want this CSS Sprite to display on my webform..if the Value is "Value2"..the CSS sprite should use some different image..just the image needs to be changed ..nothing else in that Sprite..
I found out that I can use "FindControl" method to find out what value that Label Control of Master Page's currently got..
Now how do I change that image on the banner ?? How do I go about it ? Also that CSS Sprite now is a user control named "myBanner.ascx"(earlier was an aspx file)..Now do I need to make 2 diff usercontrols or I can implement some logic in one usercontrol itself ?
Should I make 2 copies of this "myBanner.ascx" with JUST the "image name" changed in its CSS ???
Hope its not confusing..Actually I am lost :/
What I want is ONE banner which has been made using CSS Sprite ..Now if the "Label Control's "value in the master page is "Value1" then the image to be used on that banner is "IMAGE1" else if "Label Control's" value is "Value2" then "IMAGE2" should be used in that sprite..
I have a ListView showing just a list of concatenated strings obtained from different field of the objects of the datasource. A LinkButton (with CommandName="Edit") in each row Event handlers for OnItemDataBound and OnItemEditing A UserControl in EditTemplate.
Now the problem is, I don't know how to use Bind expression in the UserControl. I mean, how to populate this usercontrol when the linkbutton is clicked? (I tried capturing the control in the OnItemEditing handler. But FindControl returned null, as that handler is called before going to edit mode.)
i have 2 ascx user controls (both with VB code behind) placed in a contentplaceholder inside an updatepanel within a aspx page based on a masterpage... in the first user control i have a gridview and in the second i want to loop through the rows and get values from the first user control's gridview I would like to know how I can access the gridview of the first usercontrol from the second usercontrol please.
Im trying to add a new "Question UserControl" dynamically to my page each time the user presses "Add question". This works fine and the last control gets deleted when the "Delete question" is pressed. My problem is that in each of the "Question UserControls" i have a placeholder where i would like to add a new Textbox when the user presses "Add answer" and then delete it once the "Delete answer is pressed". The way it works now when i press add answer, an Answer Textbox gets added to the placeholders in all the added Usercontrols. But i only want to add it to the one UserControl where the user pressed "Add answer".
I have created a usercontrol to capture education details, it contains 5 textboxes and an functionto insert that values into my db. I have added the usercontrol 5 times to a page. I have a button on my aspx page which I want to be able to click and call the function to insert the values.
I have a div inside a user control that is displayed by the user after some event. I want to hide this div when user clicks anywhere elese on the page but not on the div (or not on any element that is inside the div).
If it wasn't a user control I could use body's clieck event to check the target, but because this is usercontrol that is hosted by other page I can't just "play" with it's elements. How can I achieve that without using body of the hosting page?
I have 1 ModalPopupExtender inside a UserControl. Everything works great until I start adding the same usercontrol to the page. I am getting this error message in the javascript console::
Message: Sys.InvalidOperationException: Two components with the same id 'MPE1' can't be added to the application. I understand the error, it obvious that the framework wants unique IDs. What I can't figure out is how to give them unique name.
i have 2 textbox controls inside a usercontrol TextBoxUC.ascx i have a page.aspx that contains the usercontrol. how can i get a reference to each textbox using javascript from page.aspx?
I am using jQuery to do a cascading dropdown list (State, City). In order to pull the information from the database I have a web service that I reference. The code all works like a champ when I use the JavaScript on the ASPX page for proof of concept, but when I place the JavaScript in the userControl and then put the userControl on the ASPX page, it breaks.
The next foreseeable thing that will potentially complicate things further is that the userControl will be inside of an updatePanel
I have UserControl and within that control i have asp:ListView. Inside the ListView i have a asp:LinkButton. When i click on the LinkButton the control raises full postback, no matter if the UserControl is inside UpdatePanel or is not.
I have created a real simple templated UserControl and
I can now add this control to my Asp.net WebApplication using:
[code]...
i can embed this in a page (aspx) but i is not working in usercontrol (ascx). when i use this inside usercontrol, the designer file (.ascx.designer.cs) itself not getting generated.
getting the following error:
Element 'Box' is not a known element. This can occur if there is an error in the webpage, or the web.config file is missing.
Update: sometimes it works! i created couple of controls. it works in some place and it doesnot works in someother place.
Using ASP.NET 3.5 / C#. Have a page with a UpdatePanel, and a UserControl inside the UpdatePanel. When calling ScriptManager.RegisterClientScriptBlock(this, typeof(UpdatePanel), Guid.NewGuid().ToString(), script, false); the script appears to fire (have tried it with a JS alert), but the resulting script also disappears immediately afterword. I am trying to create a JS function via the script, and it is not in the Page Source after the Page is rendered. i have tried many variationsRegisterClientScriptBlock with no luck.
I can't seem to find a textbox using FindControl. The textbox is located inside an asp:Table, asp:Table is inside a UserControl and I load the usercontrol into the parent page.
I need to insert some JavaScript code inside a UserControl that I load from an Ajax call via jQuery Ui Tabs. Let me explain... This is my View (with jQuery loaded)
<script type="text/javascript"> $(document).ready(function () { $("#tabs").tabs({ cache: false, }); getContentTab (1); }); function getContentTab(index) { var url='<%= Url.Content("~/Home/getUserControl") %>/' + index; var targetDiv = "#tabs-" + index; $.get(url,null, function(result) { $(targetDiv).html(result); }); } </script> <div id="tabs"> <ul> <li><a href="#tabs-1" onclick="getContentTab(1);">Nunc tincidunt</a></li> <li><a href="#tabs-2" onclick="getContentTab(2);">Proin dolor</a></li> <li><a href="#tabs-3" onclick="getContentTab(3);">Aenean lacinia</a></li> </ul> <div id="tabs-1"> </div> <div id="tabs-2"> </div> <div id="tabs-3"> </div> </div> With these lines of code I call the Ajax function to load the content into a DIV. This is the Action from the controller: public ActionResult getUserControl(int num) { return PartialView("TestUC", num); } And this is the UserControl... <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> Number... <span id="testSpan"><%=Model.ToString() %></span>!! <input type="button" value="Click me!!" onclick="message();" /> <script type="text/javascript"> function message(item) { alert($("#testSpan").html()); } </script>
The problem is that the message() function returns always 1 (instead of returning the correct number). My question is... How should I add the script to my UserControl in order to have my code running correctly?