I'm basically trying to get webcontrols to talk to one another.I have one WUC that wants to get information from another.In ControlB's GetDataFromControlA method
public List<ControlBData> GetDataFromControlA() { ControlA c = Page.FindControl( IdOfControlA) as ControlA; if( c != null) { return c.Data; } ... }
At code time ControlB knows nothing of ControlA...so ControlB cant access its members, and the above wont compile.
I'm thinking I have to use methods in the page to get the controls talking to one another...
I have a project made with inline code. How can I most quickly move inline code to codebehind for each webform? First, how can I add a codebehind page aspx.c or aspx.vb to one that doesn't have one?
In ASP.NET if the code and the asp.net markup is in one ascx file for example for a user control,would it perform poorly compared to a User control with Code Behind using a cs file and a designer.cs file?
Are there any differences between coding row-specific stuff inline within the repeater's template and doing so in the codebehind file in ItemDataBound?
EDIT: Re: differences - I think we're all agreed it makes for markup that's nasty to read/maintain :) I was thinking of performance benefits.
I have a e-commerce cart with many itens. Each item has a product, quantity and some other fields. Each item was developed as a WebUserControl.My e-cart will have many of this WebUserControls that are loaded dinamically as users add them, edit and remove itens of the cart.If I add this WebUserControls in a Panel, I'll have to load it every time I postBack the page. If I put it in a Repeater, the WebUserControls will keep on the screen but all the controls inside of it will be cleared.So here comes my question:How to do it without having to reload my WebUserControls everytime I PostBack the page??? It takes too long for the user
I have few inline sql statements with some arrays and if loops. I want to change them all into one stored procedure in SQL server 2005.
As i am learning SQL, i have got no idea about how it should be done with arrays and if loops. Is that possible to send arrays into stored procs or is there any other solution.
The only thing that works in the code below for me is that it does display, so I know that I am dealing with the cotrect control. But I can't get the position to change.
I am very exited to find out how to do this.I have created 10 custom webusercontrols which is meant to be used on several custom sites on my website etc. and I want to find out how I can make a directory which will work the same as the asp.net.At the moment I have to register the webusercontrol at the top of the page like this:
How do I create a directory that contains all of my webusercontrols, so I only have to register the assembly and can use the prefix and then the intellisense will appear?
I'm trying to create a table with Listview and one of the fields I'm using is supposed to show a hyperlink to a more detailed view of the data shown, how I want to do that is by using FindControl on the ID of that item and then changing the value into a hyperlink of the detailed view page with a querystring attached, the problem is that I have no idea how to re-insert that data back into the listview field, which looks something like this:
etc., which is placed inside of an ItemTemplate inside of a TemplateColumn. In the CodeBehind page I will bind a value to the OrderXml field, which occasionally is NULL.
Is in-line editing possible on a webpart??I would like to enable a user to directly edit text within a webpart, without a postback and without launching its editor.Can someone show me how this would be done? How would I save the content using a callback?
I'm not sure about the PostBackUrl property of the btnSubmit button. When I run the page, I got this error:
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format. Source Error:
I am new to inline editing. I need to be able to create a row in which one ddl waterfalls off of another. I have the first ddl populated with its proper data. How do I fire off the event for the first ddl to populate the vaules that pertain the items in the first dropdown list.I tried the following but got a Requires withEvents variable:
Protected Sub ddlDiskArrayMake_SelectedIndexChanged(ByVal sender As Object, ByVal e [code]....
I've just replaced Telerik controls in a small web project with DevExpress controls, but now, despite my adding an inline display div as container, these controls are no longer rendered inline. What could have caused this, and what can I do to get these errant controls back inline?
I tried to assign the value of button text through the following syntax where MyValue is the public variable with the value "Checkout" in the code behind.
[Code]....
But it turned out that it displayed <%=MyValue%> instead of "Checkout". Yes of course I can still assign button text value in the code behind but just don't know if there is any other solutions to it.
I have a conditional statement running on my aspx page which looks for a value from a static property (i.e. the object should not need to be declared).
[Code]....
This is the error that is thrown: "BC30451: 'CurrentSession' is not declared. It may be inaccessible due to its protection level."The class is public and to make matters more confusing, it works fine in certain environments but blows up on some.
I have a datalist which acts like a table and displays certain values. I'm trying to display a boolean value as yes or no as opposed to true or false. This is what my current line looks like, is there any way to use an inline If statement to get this to work?
[Code]....
How can I make this show yes or no instead of true or false?
I have been at this for two weeks now without any success but I know I have to get a solution to move forward with my design. Is there any way to bind data from a SQLDataSource to a Hiddenfield or Textbox WITHOUT binding via the data controls like gridview, formview, datalist, etc. I do not want to use any of those controls. I need to do inline binding. Please provide the working code example. The hiddenfield or textbox would be named eid. The SQLDataSource name is GetDataEid. Again, if you reply and you submit code I can try please provide the full working solution. These do not work. They have already been attempted: