.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

pass value from class to
-- InnerHtml

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :ASP.Net
 
Hi,I have my class "GeneratMenu" i need to direct pass the value from this calls to asp.net page which have <div id=dmenu runat=server></div>i tried in codebehin of that priticular asp page with this.dmenu.innerHtml = "Test" and it work well. But when i am using under my class like. the error comes : divmenu' is not a member of 'MyProject.MyClass'Please suggest me where is the wrong in my code?Public Class MyClass Inherits System.Web.UI.Page Public Sub createMenu() Dim xfile As String = GetXML("menu") me.dmenu.InnerHtml = xfile End SubError 2 'divmenu' is not a member of 'AccountOpening.MainCLS'. D:\Users\Nada\Desktop\BarwaBank\AccountOpening\AccountOpening\AccountOpening\Class\Main.vb 22 9 Account


View Complete Post


More Related Resource Links

Pass an Event handler to an helper class

  
I have a static class (an helper class) which has the responsability to create control and add them to a panel passed by parameter, this method is used by a lot of  user control. My problem is to create a linkbutton and define the click event handler which is not in the static class but is defined in the class which call this method. Following you find the exampleI have a static class (an helper class) which has the responsability to create control and add them to a panel passed by parameter, this method is used by a lot of user control.My problem is to create a linkbutton and define the click event handler which is not in the static class but is defined in the class which call this method.Following you find the example:public static class myHelper { public static AddControlToPanel(Panel p) { LinkButton l = new LinkButton(); l.Text = "Click"; l.CommandArgument = "click"; l.Click += Manage_CLick //Manage_Click is a method of the "caller" class p.controls.add(l); } } public class MyuserControl() { public void InitializePanel() { Panel mainPanel = new Panel(); myHelper.AddControlToPanel(mainPanel) } public void Manage_Click(object sender, EventArgs e) { //Do something } }How can I pass the handler to the static class? I have to use delegate? how?Best regards--Andrea

Pass textbox value to controller class

  

Hi All

How to pass the textbox value to my controller there is no form and post method in the view
page.

I have taken one input type textbox which is not bind with my model.

I need to access that value to controller

Please give me a solution 


Unable to pass parameter to a buisness class

  

YOur feedback would be appreciated...

I am getting this error 

Must declare the scalar variable "@InvoiceNumber".

in the following code, although i declared InvoiceNumber as a parameter in the Datasource object.


public class GetDetails
{
    public static DataSet Details(string InvoiceNumber)
    {
        SqlConnection con = new   SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        string sel = "Select InvoiceNumber,CustEmail, OrderDate,Subtotal"
               + " from [Invoices]"
               + " Where InvoiceNumber = @InvoiceNumber";
        
        SqlCommand cmd = new SqlCommand(sel, con);
        // Add the parameters for the SelectCommand.
       cmd.Parameters.AddWithValue("InvoiceNumber", InvoiceNumber);
     &

How to Pass integer value back from get and set class

  

Hi,

I am trying to set a integer value in a class from license information, and then get that value passed back to my Program.cs class (e.g. of value 10).

However when I try to return the value to another part of the class (as below) it says 'Cannot implicitly convert type to Manco.Licensing.License'. Also any idea how do I call this class to get this integer value back to Program.cs ie should this be LCheck.Value.days? In this class daysleft is a integer value.


using System;

public class LCheck
{
private Manco.Licensing.License m_License;
public static int daysleft;
public static int days;

public int Value
{
get
{

int days = daysleft;
return days;
}

}

public Manco.Licensing.License License
{
set
{
m_License = value;
daysleft = Convert.ToInt32(m_License.DaysLeft.TotalDays);
}

get
{
return daysleft;
}

}

}


Class Diagrams

  
Class diagrams show the static structure of the systems. Classes define the properties of the objects which belong to them. These include:

Attributes - (second container) the data properties of the classes including type, default value and constraints.

Creating a Simple Class in C#

  
The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Static Class for Beginners

  
In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

abstract away the source of the connection string using a class with a static property.

  
ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Encapsulation
Let's abstract away the source of the connection string using a class with a static property.

MessageQueue Class

  
This sample demonstrates two way communications using message queuing between a device application and a desktop application. One application sends book order messages to a message queue and another application receives these book orders from the message queue and responds to the device queue that the orders have been processed.

pass value from textbox to action, formcollection best way here?

  

Hi I'm building a e-commerce store and on quantity of product I'm going with a textbox. I thought I would ask how would you do this? a viewmodel to use a strongly typed textbox or just get the value of the textbox from the formscollection passed in to the action?


Thanks for any input


Pass a grid column value to a Modal

  

Hi, I have a requirement to hide a field called details on a gridview and show it in a jQuery modal dialog when users click on the Customer ID hyperlink. This grid is created programmatically. I will be hiding the details column via the CSS display:none property. Does some one know how can I pass the grid's selected hidden column value to the modal? Here is some of the code I started:

            GridView mygrid = new GridView();
            //.....................................More columns code for the grid

            //Here is where I need to pass the Details column value associated with the customer ID field selected to the Modal and open the Modal dialog.            
            HyperLinkField linkField = new HyperLinkField();
            string[] dataNavigateUrlFields = { "CustomerID" };
            linkField.DataTextField = "CustomerID";
            linkFi

How to change the default page base class?

  

I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.

Thanks,

Adam


Pass ASP.NET membership identity object across domain?

  

I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?


If this is possible, I am going to implement this solution. Please tell me what's your take on this.


How to pass value to another form

  

Dear experts,

                     I have QuoteNumber filed in Db.aspx(ddquote.txt) i want to pass this QuoteNumber values(values should to another web form/page i.e. mail.aspx when i click mail button, Message should supposed to display in textbox(txtQuote.txt) of mail.aspx form/page is "You are sending "QuoteNumber"  quotation to "MailID", Thanks.

 

 

 


Can I replace the EntityObject as base-class in Entity Designer 3.5 sp1?

  

I'm using EF3.5sp1 for a project, and I've been working around many of its problems... as such, my entity partial classes have a lot of logic in them for change-tracking and whatnot.  Obviously, I'd like to factor this logic out into a common base class, but of course all my objects must derive from EntityObject.  Is it possible to tell them to derive from some class of my own invention (which would actually likely derive from EntityObject themselves)?

I'd rather avoid editing the EDMX file unless the changes will be safe on entity-model-update, since I'm still making changes to the database schema in this early state of my project.

Thanks

Also, is there any good workaround for the fact that the change isn't tracked when you change EntityReference.EntityKey?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend