|
You may be assigning to the DataSource property in your code behind file.
|
|
|
|
|
thanks my friend ... now it's ok
jooooo
|
|
|
|
|
I'm using Sitefinity (www.sitefinity.com) and trying to get two custom built controls to talk to each other. I'm looking for suggestions as to how I could accomplish this. I'm using .Net 3.5. Right now I can pass data one way using the Page.Context.Items collection and viewing that from the OnPreRender().
One control is a breadcrumb generator and the other is a browse control. The two should work in tandem. When the breadcrumb trail is clicked the navigation should update with that level's sub-items. And if a sub-item is clicked in the navigation control the breadcrumb should update accordingly (standard breadcrumb + navigation setup going against a heirarchical table)
These controls are added to the page from the sitefinity interface, so I don't know what the ID or ClientID of these controls will be as it is controlled by the sitefinity CMS software. I do have access to the Page object inside each control. I would love to use Events to communicate between the two, I'm just not sure how to make that happen or where in the page / control lifecycle to do it.
Any suggestions?
|
|
|
|
|
Hi!
I made a test on the issue. Check my code snippets:
EventInterface:
public delegate void ControlChangedDelegate(ControlChangedEventArgs e);
public class ControlChangedEventArgs : EventArgs
{
private object controlInfo;
public object ControlInfo
{
get { return controlInfo; }
set { controlInfo = value; }
}
public ControlChangedEventArgs(object info)
{
controlInfo = info;
}
}
public interface EventInterface
{
event ControlChangedDelegate ControlChanged;
void Updatecontrol(object info);
}
The page:
public partial class _Default : System.Web.UI.Page, EventInterface
{
protected void Page_Load(object sender, EventArgs e)
{
}
#region EventInterface Members
public event ControlChangedDelegate ControlChanged;
public void Updatecontrol(object info)
{
ControlChanged(new ControlChangedEventArgs(info));
}
#endregion
}
Control 1:
public partial class WebUserControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
((EventInterface)this.Parent.Page).ControlChanged += new ControlChangedDelegate(WebUserControl_ControlChanged);
}
void WebUserControl_ControlChanged(ControlChangedEventArgs e)
{
string s = e.ControlInfo.ToString();
}
}
Control 2:
public partial class WebUserControl2 : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
string controlInfo = this.ID;
((EventInterface)this.Parent.Page).ControlChanged += new ControlChangedDelegate(WebUserControl_ControlChanged);
((EventInterface)this.Parent.Page).Updatecontrol(controlInfo);
}
void WebUserControl_ControlChanged(ControlChangedEventArgs e)
{
string s = e.ControlInfo.ToString();
}
}
i have not made any extensive test on this but i think it will work.
|
|
|
|
|
I have a user type in some information, it calls and API and returns an XML document. I then show some more entry fields that are based on what they entered on the first API submission. I then need to take what they typed in after the first submission, use that to edit the created XML and then submit to another API.
What is the best way to save XML between post backs? session varialbe, save a string in a database and do a load, something like _serviceXML.LoadXml(Session("addServiceXML").ToString)? If I was working in windows forms I would use a get/set to do this.
Thanks.
andy
|
|
|
|
|
It depends on the amount of xml. If it isn't too big then use session. BTW, it is a good practice to create a class of of session items with properties (get / set) for each item. That way when you access the item in your application you can't cause an error by making a typing mistake.
Also, you can store a [serializable] object in Session. It doesn't have to be a string.
I didn't get any requirements for the signature
|
|
|
|
|
Hello Friend's
i want file copying from 1 source to multiple destination How it is possible please help me?
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Do the copy once to each destination?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks For reply
Absolutely Like this but copy at a time on all disk destination drive.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Well, based on your lack of explanation, try using multiple theads, but don't be suprised if it runs slowly as you will be getting disk contention on the read.
How do YOU think it can be done?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
udhuman wrote: I Need simple program for dataset exchange (WDDX) in .net
Wrong website. Try rentacoder.com, the idea of CP is YOU write code and other people help you fix problems.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks i got the idea and done already
|
|
|
|
|
udhuman wrote: pls send to mail2udhuman@gmail.com
Not sure whether this type of reply gets you a solution or not in this forum, typing an email address in the discussion board is a sure stop way to invite tonnage of spam. But you are using GoogleMail which is still in Beta Testing and you should really be helping GMail Team in testing their spam filters.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
I face an error at my aspx page i.e. Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site.
Even I installed AjaxToolkit and ScriptManager Tool is in my ToolBox.
Pls Support.
Gautam
|
|
|
|
|
Do you have a compilation error in your website?
|
|
|
|
|
what type of error you get. please explain in brief.
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
Check the new website you have selected is AjaxEnabled website or not!!
Cheers!!
Brij
|
|
|
|
|
hi
i'm trying to get a reference to a control on GridView RowEditing event:
code behind:
protected void gvChores_RowEditing(object sender, GridViewEditEventArgs e)
{TextBox txtEditMsg = (TextBox)gvChores.Rows[e.NewEditIndex].FindControl("txtEditMsg");}
javascript:
<asp:TemplateField HeaderText="Chore">
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtEditMsg" Text='<%# DataBinder.Eval(Container.DataItem,"Chore_contents") %>'/>
</EditItemTemplate>
</asp:TemplateField>
i can't get the reference (returns null)
can anyone advice what i'm doing wrong and how can i get the reference to the control?
thanks in advance
|
|
|
|
|
try:
protected void gvChores_RowEditing(object sender, GridViewEditEventArgs e)
{
TextBox txtEditMsg = (TextBox)e.Item.FindControl("txtEditMsg");
}
remember that the DataRowView is:
System.Data.DataRowView drv = (System.Data.DataRowView)e.Item.DataItem;
Hope it helps
Thomas
|
|
|
|
|
Thanks Thomas, but the GridViewEditEventArgs does'nt contain a definition for 'Item'..
|
|
|
|
|
Sorry, I was thinking about DataGrid not a GridView.
It seems to me that you are trying to uppdate the row,
hens the
Text='<%# DataBinder.Eval(Container.DataItem,"Chore_contents") %>'/>
So you should use:
protected void gvChores_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = gvChores.Rows[e.RowIndex];
TextBox txtEditMsg = (TextBox)row.FindControl("txtEditMsg");
}
Becouse RowEditing works like this:
protected void gvChores_RowEditing(object sender, GridViewEditEventArgs e)
{
gvChores.EditIndex = e.NewEditIndex;
BindData();
}
To be honest, I have never used GridView since I always use DataGrid, so I might be wrong.
modified on Thursday, October 2, 2008 6:09 AM
|
|
|
|
|
thanks. previous comment wasn't relevant... i missed that you've handled RowUpdating event.
thanks for your help
modified on Thursday, October 2, 2008 6:56 AM
|
|
|
|
|
Hi All,
I user checkboxlist which is in UpdatePanel(AjaxTool) n when I select a checkbox in list the data from database should be filed in another checkboxlist depnds on previous Checkoxlist. Both checkboxlist have seprate updatepanel.
Pls Guide
Amit
|
|
|
|
|
And whats the problem??
Just do it as you would if there were no updatepanels
Alexei Rodriguez
|
|
|
|