Recently we started using .Net User Control for developing one of our Applications. Its a CTI application communicating with Cisco UCCX integarting with Microsoft Dynamics CRM. So its a Request/Response Mechanism.
We've one .aspx page where we embedded our Control and Registered there. I've Iframe and few other Dummy components inside this Iframe.
so scenario is like: Whenever there is any event coming from UCCX, we r capturing that event in code behind (within Handler function below) and based on that, generating URL for CRM to be open in Iframe and then setting Iframe "src" property in code itself
to populate that Iframe.
Now my problem is, whenever there is any response coming from UCCX server into User Control, its coming into If() condition but Iframe isnt being populated with correct URL im specifying. And its always taking URL mentioned in Page_load(). What i want instead
is that if satisfies if() condition, it shud populate Iframe with that URL only.
Any help Appreciated !
What wrong is happening and where im doing wrong ? Can anynody pls tell & suggest me some alternative and solution.
I put code like : Iframe1.Attributes.Item["src"] = "some Micrsoft Dynamics URL generated here";
but its giving error mentioned below while Compiling :
Error 'System.Web.UI.AttributeCollection' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Web.UI.AttributeCollection' could be found (are you missing a using directive or an assembly
reference?)
Error 'System.Web.UI.AttributeCollection' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Web.UI.AttributeCollection' could be found (are you missing a using directive or an assembly
reference?)
Hi,
First please try to make sure you have add the 'System.Web.UI.AttributeCollection' reference which is in
Namespace: System.Web.UI
Assembly:System.Web (in System.Web.dll)
Then in the 'System.Web.UI.AttributeCollection', there have no definition for the item method, for more information, please try to refer to:
mayankmathur
0 Points
8 Posts
Regarding Issue with User Control
Feb 13, 2013 10:34 AM|LINK
Hello Everyone.
Recently we started using .Net User Control for developing one of our Applications. Its a CTI application communicating with Cisco UCCX integarting with Microsoft Dynamics CRM. So its a Request/Response Mechanism.
We've one .aspx page where we embedded our Control and Registered there. I've Iframe and few other Dummy components inside this Iframe.
so scenario is like: Whenever there is any event coming from UCCX, we r capturing that event in code behind (within Handler function below) and based on that, generating URL for CRM to be open in Iframe and then setting Iframe "src" property in code itself to populate that Iframe.
Code is like :
control.ascx
<iframe id="iframe1" runat="server" frameborder="1" marginwidth="1" name="I1"
scrolling="auto" visible="true"
style="position: absolute; top: 263px; width: 1018px; height: 300px; left: 168px; margin-top: 0px; right: 18px;"
title="MD URL" onclick="return I1_onclick()">
</iframe>
control.ascx.cs
Protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HtmlControl Iframe1 = (HtmlControl)this.FindControl("iframe1");
Iframe1.Attributes["src"] = "http://www.microsoft.com/en-in/dynamics/default.aspx";
}
}
Handler(string xml)
{
.......
if (eventtype[0].InnerText == "CallDelivered")
{
HtmlControl Iframe1 = (HtmlControl)this.FindControl("iframe1");
Iframe1.Attributes["src"] = "some Micrsoft Dynamics URL generated here";
}
Now my problem is, whenever there is any response coming from UCCX server into User Control, its coming into If() condition but Iframe isnt being populated with correct URL im specifying. And its always taking URL mentioned in Page_load(). What i want instead is that if satisfies if() condition, it shud populate Iframe with that URL only.
Any help Appreciated !
What wrong is happening and where im doing wrong ? Can anynody pls tell & suggest me some alternative and solution.
Thanks in Advance.
Regards,
Mayank
rajaron
Member
657 Points
202 Posts
Re: Regarding Issue with User Control
Feb 13, 2013 10:52 AM|LINK
Try this
ifrm.Attributes.Item["src"] = "some Micrsoft Dynamics URL generated here";
mayankmathur
0 Points
8 Posts
Re: Regarding Issue with User Control
Feb 13, 2013 11:03 AM|LINK
Hi,
I put code like : Iframe1.Attributes.Item["src"] = "some Micrsoft Dynamics URL generated here";
but its giving error mentioned below while Compiling :
Error 'System.Web.UI.AttributeCollection' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Web.UI.AttributeCollection' could be found (are you missing a using directive or an assembly reference?)
Amy Peng - M...
Star
9968 Points
952 Posts
Microsoft
Re: Regarding Issue with User Control
Feb 21, 2013 01:14 AM|LINK
Hi,
First please try to make sure you have add the 'System.Web.UI.AttributeCollection' reference which is in
Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Then in the 'System.Web.UI.AttributeCollection', there have no definition for the item method, for more information, please try to refer to:
http://msdn.microsoft.com/en-us/library/system.web.ui.attributecollection.aspx .
Best Regards,
Amy Peng
Feedback to us
Develop and promote your apps in Windows Store