C# - How To Access A Silverlight Control's Properties And Methods From An Aspx Page
Apr 26, 2010
I'm developing a web site, and i'm using infragistics for web, but I want to use in some pages silverlight controls (Infragistics too). Is there a way to access a silverlight control's properties and methods from an aspx page?
View 3 Replies
Similar Messages:
Nov 29, 2010
I'm using ASP.NET with VB, and .NET version 3.5. In the project, I've got some utility functions that I call from expressions in the aspx pages and also in code behind. This all works fine on my local machine, but when I deploy to the production server, I get this compilation error on each of those utility methods:
BC30456: 'XXX' is not a member of 'String'.
where XXX is an extension method defined on System.String. I'm baffled about this for a number of reasons:
Why is ASP.NET compiling anything at all, since I've precompiled the application and put everything in the bin directory. ASP.NET knows the functions are there because they work in code behind. It's only when used in the aspx page that I have this problem. (e.g. if I do something like this: <%= "A string to XXX-ify".XXX())%>) This method is public, which I verified with Reflector. I imported the relevant namespaces in the web.config file, and I can see that these namespaces are being imported in the call that ASP.NET makes to the compiler.
View 1 Replies
Jan 28, 2010
I am on .aspx page and i want to take the width and height of a control from a static class
where i have defined them as constans.
Is there any way to access that class directly from the aspx page?
I know that i can make a method like:
width="<%= getWidthSize() %>"
and inside the aspx.cs to define this method to take the size from that static class.
But i am asking if this could be directly managed from the web aspx page...?
View 2 Replies
Feb 15, 2011
i have made a user control carrying a grid which is showing different uploaded images , description etc. I am putting this in another aspx page and want to fetch the values of the silverlight grid. I have made a class file for that but unable to get the grid collection.
View 1 Replies
Feb 28, 2011
I've got a composite control (class) that exposes an asp:Label through a get-property. Is is possible to set the Text property of the Label through aspx-code?
I'd like to do something like this:
<cfw:MyCompositeControl runat="server" Label.Text="Test" />
One solution is adding each property to the composite class (like a public LabelText), but I'd like to set any property of any child control. So as new features of child controls become available, I'd like to be able to use them on my composite control. So basically I would like to set any property of the exposed child control.
View 3 Replies
Feb 23, 2011
As a starting point for creating custom controls, I would like to make a control that simply displays a number. If we imagine the .ascx file contains nothing except for a literal control, and the code behind sets that value to 1.
I then want to be able to do myControl.increment();
This will run some javascript that increases the value of the literal control.
I could inject a javascript into the page, such as pseudocode:
page_load
{
scriptything.register("function increment(x) { $('#myLiteral').increment(); });
}
or something, but that wouldn't be myControl.increment, that would just be increment(). More than one control on the page would screw it up.
View 2 Replies
Aug 19, 2010
I have added a static string variable inside a web page with it's class named VersionBase. The class is public, the variable is public, why can't I simply do VersionBase.MyString from anywhere inside the project like I can do with any other class?
View 13 Replies
Mar 30, 2010
I have lot of methids in my mastre page how do i use them in my User control? I dont want to copy paste the code
View 2 Replies
Feb 7, 2011
I have a button control called "btnAdd" located at a cuser control. I am using the usercontrol in an aspx page. I need to create a new button control in the aspx page that reference to the button control (btnAdd) located in the user control , so I can use its code in the aspx page.
View 4 Replies
Jun 16, 2010
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?
View 3 Replies
Jan 18, 2010
i have a hidden textbox in my aspx page. The aspx page also has a masterpage in the <% @Page> directive.
<input type="hidden" runat="server" name="txtType" id="txtType" />
actually in aspx.cs i am getting txtType.ClientID="ctl00_MainHeaderContent_txtType"
I have a webpart in a webpart zone in this aspx page. In the webpart CreateChildcontrols() I need to access this hiddenTextbox value. I am able to access it as
string TxtValue = this.Page.Request.Form["ctl00_MainHeaderContent_txtType"];
But instead of hardcoding I want to access as a control in the page or form. How can I do that I want to do as looping through the controls in the page but Page.Controls.Count gives 1 and that is MasterPage. How can I get the entire controls in the page and loop through and find the hidden textbox. I also tried as string TxtValue = this.Page.Request.Form["<%=txtType.ClientID%>"] in CreateChildControls() of the webp[art. But could not access hidden textbox like this.
View 2 Replies
Feb 21, 2010
How to embed silverlight xap into aspx page. I have created students database. I want to keep search option to find student name. It should be done in silverlight. I want to embed that silverlight in aspx page.
View 6 Replies
Oct 6, 2010
I have two frames in a Silverlight application.
One frame contains a TreeView control. When a user clicks on one of the TreeView's items then I want an ASPX page to be loaded into the next frame.
How can I achieve this?
View 1 Replies
Jul 23, 2010
We have a silverlight/asp.net application which communicates with WCF to fetch data. Now we are facing a problem where in the silverlight component is taking some time to initialize after the asp.net page life cycle is completed.We have tried tracing all the events and found that there is a time lapse between the aspx page unload event and silverlight initialize event. This we have tried with even a simple application (hello world) but still have found the same result.There is nearly 3-4 seconds delay i.e the silverlight component initialization starts 3-4 seconds after the page unload event ends.
View 1 Replies
May 19, 2010
I need to configure a property of a custom control I wrote, specifically before the control calls OnInit. If I assign it as part of the ASPX file, it naturally works, but if I instead move the assignment to different parts of the code-behind, it will throw an error for having an empty and invalid value. The following is what it looks like when functional in the ASPX page.
<MyCustomControls:SingleCascadeLookupMulti FilterString="Seventh" FilterByStatus="true" ControlMode="New" FieldName="Speciality" EnableViewState="true" ID="sclmDocuments" runat="server" TemplateName="SingleCascadeLookupMulti" />
The property in question is FilterString, which is just a simple string. It should be noted as well that the FieldName property (inheritted from the control's base class "BaseFieldControl") would also throw an error if it is not initialized, but if I set FieldName in the code behind's OnInit method, it works correctly. FilterString is not so, it won't actually be assigned. So I know that some methods for certain properties will work for setting the property's value, but it won't always work. I tried placing it in OnPreInit as well, to no avail.
I am taking a dynamic assignment approach because the functionality of this page needs to be replicated for a number of different lists, and the FilterString and FieldName properties will differ in every case. Rather than write half a dozen mostly-identical aspx pages all with the same code behind but differing just in what those two properties are, I figured it would be wiser to use the page's query string and some derived parameters to set those properties dynamically. As such, what methods are available to accomplish this task?
View 1 Replies
Mar 3, 2011
I have got 3 aspx page and a usercontrol on each page have an email placeholder in it. What I want to acheive is when the customer click on the usercontrol email placeholder, certain method on a particular page should trigger. See below for the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Tangent.Breakingfree;
[Code]....
Also I have got another method on a different aspx page, I want to trigger that method when the client is on that page. The user control should trigger the right method depending on the page user is currently on.
View 2 Replies
Jan 15, 2010
Is it possible to do something like this inline in an ASPX page?
<%= Me.SomeExtensionMethod() %>
I can't seem to figure out how to get this to work properly. I'm receiving an error saying that "SomeExtensionMethod" is not a member of the current Page object. I've added the necessary <%@ Import Namespace="..." %> directive at the top of my page. This Does work in code-behind.This isn't vitally important, but it would be good to know how to do in the future.
View 2 Replies
Jul 21, 2010
I have a ASP.Net project that is setup in such a way that it can be dropped into any site and "just work." All the paths are relative to the current file, not relative to the "~". The paths are determined by ThePath = this.TemplateSourceDirectory;
This is working for everything expect registering a custom control that is created and added to one of the pages. I can add the control just fine with the Page.LoadControl but I cant cast it as the correct type to access anything.
How can I add a reference to the class from within the code itself?
View 2 Replies
Sep 2, 2010
I want to send data from my silverlight application to a aspx page. But i don't want to pass parameter in the url when calling the aspx page.
So i figure the best way is to do a POST. But i'm not too sure how to do it..
View 1 Replies
Jul 29, 2010
I am new to silverlight and I am wondering if it is possible to access silverlight object data from the aspx page that host it. Or have silverlight write to a hidden field on the page on client side.
What I am trying to do is to use silverlight to upload file via WCF (client to WCF Service directly instead of posting data back to the web server then forwarded to WCF service). When uploading a large file, user can still do some data entry etc. And once the upload is done have it write some data return by the WCF service to the aspx's hidden field and postback to the server on submit.
View 1 Replies
Jul 15, 2010
I'm calling a silverlight component in my aspx page like this
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="silverlightControlHost" > [code]...
I would like to modify my page aspx so it takes the parameter itself. Today I'm calling the page
Config.aspx and I would like to do something like this call it
Config.aspx?ConfiguredCarId=11
How do I modify the above code to reflect the change?
View 1 Replies
Aug 23, 2010
I have an aspx masterpage that I would like to use in Sketchflow in ExpressionBlend as a Silverlight project. I am totally out of my comfort zone here and am not even sure how to ask this question. This masterpage has a Header and a Footer and the middle section will contain the Content - which will actually be Silverlight. Is there some easy method to bring the design (aspx) into Sketchflow to use?
View 1 Replies
Jun 14, 2010
How can I call aspx content page methods from usercontrol?
View 2 Replies
Mar 3, 2011
I have got 3 aspx page and a usercontrol on each page have an email placeholder in it. What I want to acheive is when the customer
click on the usercontrol email placeholder, certain method on a particular page should trigger. See below for the code:
[Code]....
View 4 Replies
Oct 6, 2010
I want to add a button to my user control in SilverLight 4.0 application which will open a new browser window with an aspx in it when it is clicked.
Additionaly, can I lock the SL application until this new window is closed (Alike a modal dialog)?
View 2 Replies