I have a requirement to display a user control on my aspx page that accepts a URL as a property, and loads that URL in the aspx page (similar to the Page Viewer web part in SharePoint).
How would i go about loading a different control over an existing control?
By this i mean when i visit a page, a control is loaded into a PlaceHolder or Panel control, and then after i am finished with that UserControl, i want to clear it out and then load the next control in its place.
I have tried doing PlaceHolder.Controls.Clear but it still retains the first control and doesnt even add the next control to it at all.
The initial control is a data-entry control (Insert/Edit). Once the user does the data-entry (Insert for this question) needed, they click the Insert button, the data gets inserted into the database correctly then i want to pass control back to the parent page and have it load the next data-entry usercontrol in the place of the initial usercontrol.
I have tried doing it dynamically, with one placeholder control but that didnt seem to work. I tried doing it via a MultiView control with each of the data-entry usercontrols needed being pre-loaded into their own view and i couldnt get the Mutli-View to change activeindex.
so I have this custom user control, just some data inside divs with a fancy css.
So inside my page I need to add it multiple times, and I do so in code behind within loop.
Now, this code doesn't work
[Code]....
and of course it works fine now. My questions would be - why? can I do it without pecifying file name and just creating control the normal way like in first example?:S
I can't figure out how to get the legend to populate all the "strReason" and get the correct percents to show for each column. This is where I'm at right now.
i have a page it contains a User Control. in it we have a Button "View Tree" it will open a pop up window (contins a tree view).when we select any node in the tree the Corresponding item will be Loaded in the User Control and Close the Popup.i want to achive this With out re loading the total page. i am using VS 2008.
I have a .net Chart Control working beautifully in IE, but when I test it in Firefox, the chart initially does not show up. I do a shift+reload and it then does show up (?)
1) I have the .net Chart Control set to run in memory in the web.config:
Bringing back to life an old post that I dont believe ever got solved: http://forums.asp.net/t/1562245.aspxThis may be an old thread .... but no answer was ever given ... and I too have a radio button list and DDL and am stuck in the EXACT same place. If I check one of the two data bound radio buttons, the DDL should repopulate with a different set of results. This works just fine EXCEPT .... the DDL cannot be databound. If I set SELECTEDVALUE of the control to a bind I get this error:Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.I have followed the advice on this page from various users, all to no avail....surely this can be done, and I assume quite simply. Anyone know the answer?
iam into problem of reading the value of the control which i alterd using javascript the sequence goes like this i got the text box control by using its id ,cleared the value of the text box,make the control disabled.when i tried to retrive the value of the textbox in aspx.cs.iam still getting the old value of the text box which i actualy cleared in the javascript
i created a user control called userCon.asxc. may i know how do i do when i click on button1, then the userCon.asxc will load into panel1?
I checked on internet, but found only those loading the user control to page when execute. What i want is to load user control into panel1 when button1 is click. .
I bind to the Repeater through the myRepeater_Load event handler. My custom control is used to render an item within the Repeater. Because of this, I am trying to set properties on the custom control during the myControl_Load event handler. However, I do not know how to access the current item during the myControl_Load event.
Is there a way I can pass along the current item or access the current item during the myControl_Load event? If so, how?
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(@"CustomControls.Nav.dll"); //Namespace and assembly name are CustomControls.Nav , the class name for the control is WebBar Type type = assembly.GetType("CustomControls.Nav.WebBar");
I am getting type as null.What am I doing wrong here?
I encounter a problem...error is Ajaxcontroltoolkit.dll is in bin folder, but still I get this follwoing error.Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The module was expected to contain an assembly manifest.My code is (in .aspx file):
I have update panel on the page to avoid postback and placed a dropdownlist control within that update panel. DrodownList is filled with Category names and also it's autopostback set to True.
Now whenever dropdownlist index change's on select, untill page loads complete data it should show mesage as "Loading.... in center and middle of the page and background should become bit transparent". And when page load completely with data then that background and message should get disappear.
I have a folder C:Images which has a some images. This folder is not inside my project and I would to know if there is a way to load an image from that folder on to an ASP.NET Image control.
<asp:Image ID="img" runat="server" />
One solution could be to make the Images folder a Virtual directory on the IIS but I would like to know if this can be done without creating a virtual directory for the Images folder.
I'm creating a simple CMS for a fairly simple web page. I'm currently working on a part for displaying news on the main page.
The controls I have on the page:
- a GridView control with enabled pagging and a SELECT button, - an Image control for displaying news cover picture, - CKeditor control for editing news text, - Repeater control for displaying pictures from database
How does it all work?
In Page_load I have the following:
vb.net Code: connectionString = "Data Source=KORISNIK-PCSQLEXPRESS;Initial Catalog=****; User ID=**;Password=****" conn = New SqlConnection(connectionString) If conn.State = ConnectionState.Closed Or conn.State = ConnectionState.Broken Then Try conn.Open() If Not IsPostBack Then bindGrid()
[Code] ...
As you can see, I load the GridView control with news from DB. At this moment all other control are disabled. User has to SELECT the row he wants to edit, and click the MODIFY button.
This is what happens when user clicks the MODIFY button:
vb.net Code: Private Function selectForEdit() dsSelectForEdit = New DataSet captionPicture.ImageUrl = "" enableCommands() Dim sqlQuery As String sqlQuery = "SELECT news.newsCaption, news.newsIntro, news.newsCoverPicture, news.newsStatus,
[Code] ....
Basically, I select newsDetails based on newsID. Also, this is where I take the coverPicture from the database using a generic handler.
This is the code for showImage.ashx:
vb.net Code: Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim newsID As Int32 If Not context.Request.QueryString("newsID") Is Nothing Then newsID = Convert.ToInt32(context.Request.QueryString("newsID")) Else Throw New ArgumentException("No parameter specified") End If
[Code] ....
This part works fine, as the picture is correctly displayed in the Image control. Now, I also want to load the pictures that are related to the selected news. So, I use this function:
vb.net Code: Private Function selectNewsPictures() dsSelectPicturesForEdit = New DataSet enableCommands() Dim sqlQuery As String sqlQuery = "SELECT newsDetailsPictureID,newsDetailsPicture,newsDetailsPictureCaption,newsDetailsPictureDescription FROM newsDetailsPictures WHERE newsID = @newsIDEditing" myCommand = New SqlCommand(sqlQuery, conn) myCommand.Parameters.Add("@newsIDEditing", SqlDbType.Int, 250)
[Code] ....
You can see that I take pictureID's and store them into a List (of integer). That way I can use those integers in showNewsPictures.ashx to display all the pictures.
showNewsPictures.ashx:
vb.net Code: Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim newsID As Int32 If Not context.Request.QueryString("pictureID") Is Nothing Then newsID = Convert.ToInt32(context.Request.QueryString("pictureID")) Else Throw New ArgumentException("No parameter specified") End If
[Code] ....
The picture ID's are being sent through pictureRepeater_ItemDataBound:
vb.net Code: Private Sub pictureRepeater_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles pictureRepeater.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then Dim ctrl As New Image ctrl = e.Item.FindControl("pictureHolder") ctrl.Width = 100 ctrl.Height = 100 ctrl.ImageUrl = "~/showNewsPictures.ashx?pictureID=" & listOfIDs.Item(itemIndex) itemIndex = itemIndex + 1 End If End Sub
THE PROBLEM:
I load the page, select the news, click the MODIFY button and all works well. The news details are loaded, the cover picture is loaded, the repeater pictures are loaded.
I click the cancel button (clears all the commands and disables them) and I get an error saying the DataReader needs to be closed.And I never use one This happens either in showNewsPictures.ashx or showImage.ashx.
In some other scenario, this happens right after I click the MODIFY button.
i have developed my asp.net application along wih crystal report .... i need to show loading image on ever client and server side request .... (i.e) like when ever IE progress bar get loading i want to show my gif loading ... after IE progress bar finish its loading, my gif loading image should disappear .
I am experiencing an issue with the TreeView control when loading new pages. It is databound to web.sitemap, but when loading a new page, it does not select the node of the current page, just resets it to the root. THe new page loads fine, just not preserving the current navigation in the tree view.
I know there is another question asking the same thing, but it hasn't gotten any attention for months now:
How to force Ajax Control Toolkit scripts loading from CDN?
I've upgraded my website to .NET4, and I'm now using the scriptManager's EnableCDN="true" tag. My Ajax scripts are being referenced from the Microsoft CDN just how I expected, but I can't seem to get my AjaxControlToolkit scripts to load from the CDN. Instead they all load locally through ScriptResource.axd.
I know where the CDN files are located, and I know that I could reference those files every time I use a control, but I've got a lot of legacy code that loads on its own from the scriptmanager, just pulling ScriptResource.axd files.
how to get the control toolkit scripts to load from the CDN? I already have the standard WebForms.js, etc.
Let me know if there is anything I can clear up, here is the script manager that I'm using: (I have tried the toolkitscriptmanager)
I have a usercontrol which has a combobox inside it.
This UserControl is the inside an asp panel - and when the panel is visible, the dropdownlist within the control binds to its datasource and behaves itself.
When the panel visibility is set to false, the dropdownlist within the usercontrol is empty.