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

Post New Web Links

Passing data from a DetailsView to an Applet

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
I have a DetailsView that I am trying to use to pass results to an applet's parameter list but I can't figure it out. Example: <asp:DetailsView ID="..."....     <Fields>         <asp:boundfield Datafield="Name".../>         <asp:boundfield Datafield="Name2".../>          ...etc.   <applet codebase="http:/..." ...> param name="Name" value="value of Name from my DetailsView" /> param name="Name2" value="value of Name2 from my DetailsView" /> ...etc. I have been trying all sorts of things and viewing tutorials, etc, but I just don't seem to be able to figure this out.        

View Complete Post

More Related Resource Links

Passing Data to a Cell in Excel



I have a webpage that is created in Visual Studio 2008 and programmed in C#.

I have a web form that prompts the user to enter a value into a text box.  For now, I do not have any validation on that field (I will be adding that later).

I need to pass the value that the user has entered to cell C1 of the excel spreadsheet (user_info.xls).

I understand that using excel is not ideal, but unforutnately need to try to make this work with the excel spreadsheet.

I do not have any code for this yet, because I honestly do not know how to begin.

The action of poulating the excel spreadsheet will be intialized from the On Click event of a Submit button.

Any suggestions would be much appreciated.

Thank you in advance for your assistance,


Passing data to the client and back - best way?

I'm ok (I think) with using a data bound Custom Control on the server to get hold of my data (it will be part of a larger dataset) and to ultimately pass updates to the database.  The bit I'm researching at the moment is passing that data to and from the client. One way to pass the data to the client is to use JSON within the Pageload event to construct a set of Javascript objects (one per row in the data).  Is that the best way, or am I missing something? Then, after the data has been manipulated on the client, I need to pass the rows back again so that the server side code can pick them up and process the updates.  I've seen a suggestion on here that a hidden text field is one way to do that.  Is it the best? Neither of my approaches seem to be at all elegant - and I suspect that I am missing something fundamental in ASP .NET AJAX! Thoughts welcome, Thanks, Nick

Passing data from a nodeset to another webpart

Hello, I currently have a page with three webparts.  A form webpart, a dataview webpart, and a chart webpart (Dundas).  I have been able to successfully pass a selection from the form webpart to the dataview webpart.  My problem is arising when I try to get the filtered data from the dataview webpart into the chart webpart.  I cannot find a way to pass either the linked datasource with the filter criteria or the nodeset that is being used in the dataview.  Can someone please point me in the right direction of how to pass the xslt data from my dvwp to my chart webpart?   Thanks, Jon

Problem binding data to DropDownList in DetailsView

Hi guys. I have a slight issue I awas trying to fix for 2-3 days, but nothing I try works. The scenario: DetailsView control in edit mode, I pass parameters to the SqlDataSourceProducts (edit.aspx?id=2) and the data source selects the appropriate data and fills in the DetailsView form. Except two drop down lists. These two DDLs (DDL2 and DDL3) are dependent on the previous DDL (DDL1) in the DetailsView. Thanks to PeteNet, when the selected value of the DDL1 changes, DDL2 and 3 change their lists and get bound to the database. The problem is: when I edit something from the database, DDL2 and 3 appear empty and when I update any other field and leave these, they get blanked in the database.  My goal is to set the selected value of DDL2 and 3 to the values in the database WHERE ID = QueryStringField="id". I can go for not binding the data unless the field is changed, but does not sound professional and user friendly. code: The SqlDataSource used to select the parameters from the table and populate the DetailsView <asp:SqlDataSource ID="SqlDataSourceProduct" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT ID, wm_number, upc, check_digit, unit, price_unit, brand, category, shelves, type, cooking, storage, packaging, origin, nutriti

Exposing data contract without passing as input or output parameter for any operation contract


I have a method in  wcf which returns stream of custom object. I need to deserialize this stream at client side, but my custom class which is exposed as data contract is not visible through client proxy. When I add a dummy operation contract which returns the custome object I am able to get this custom class. I dont want to write this dummy method as there are many such custom classes.

Is there any way to expose data contract without writing any operation contract that returns or accepts data contract type object?





Retriving data from CheckBoxList and passing it to a Session



I wondering how can I retrive data from a CheckBoxList in c#. and once I get the data I would like to store the data in a session so I can use the data from a session on a another page

Thank you in advance

problem when passing data from view back to controller?


I have following situation - I am pasing user info object from Controller to View. It contains GUID UserID,  which i dont want to be seen on page.

So I  removed every   Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc... from generated View source.

And because of this when Html.BeginForm() returns that object back to Controller  all values is there but UserID is lost??

If I leave Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc.. in View everything is fine.

But I dont want to show UserID?

Where is the problem here?

                <%= Html.LabelFor(model => model.C__User_Id) %>

Exposing data contract without passing as input or output parameter for any operation contract


I have a method in  wcf which returns stream of custom object. I need to deserialize this stream at client side, but my custom class which is exposed as data contract is not visible through client proxy. When I add a dummy operation contract which returns the custome object I am able to get this custom class. I dont want to write this dummy method as there are many such custom classes.

Is there any way to expose data contract without writing any operation contract that returns or accepts data contract type object?

Passing data to a Controller from global.asax


Hello all! I'm in a situation where I need to pass some information (state) to a base controller from which all of my controllers derive. In my global.asax, I'm calling a web service to get some state about the user. This state applies to every page in my web app, so the base controller needs to know about it. The state consists of about 4 fields. Is there a standard way to do this? 

I'm using ASP.NET MVC 2.

Thanks in advance for your time!


Passing a Particular data from a DB to a label control


Hi Guys,

Sorry as I dont know if im using the correct term. but this is my problem. I have a dropdown which shows the NAME from a database. when the user selects the name, I need to display some of the data of the selected name to 3 Label controls. the data in particular are IDnum, Address and Status.

Here's my code.

 strSELECT = "SELECT IDnum,Address,Status FROM EmpStat WHERE Name = '" + ddlAC.Text + "'"

 cmdSELECT = New SqlCommand(strSELECT, con1)


I'm stuck here, How do i now display the values in my Label controls?


passing form data between pages


Hi All,

I have to split a long form into two pages. In the first page, I have a  button "Next Page" to second page and in second page, a button "Previous page" to go to first page. How do I keep the form data when click "next page" and "previous page"?

I am using session variables to pass the form data. I have the server control Enableviewstat as true, but it still doesn't work. What else should I do? My code as below:

  protected void btnNext_Click(object sender, EventArgs e)
            Session["fname"]= txtFname.Text;



HELP with Code passing data to new page


Hi all

Not sure which section of forum this should gi in. I have a gridview in one page and if the user wants to edit a row, I open a new page with a detailsview for editing.

On the new page I have a text box to display the primary key of the record selected from the prior page called Log Number. Then on the new page I have a where clause on the detailview to display the record with the primary key.


The problem I need help with is the code for the findcontrol. I copied from the MSDN site and it does not bring back the selected log number. Please keep in mind I do not do much coding. Thanks in advance.


Here is the code:

protected void Page_Load(object sender, EventArgs e)
  if (PreviousPage != null)
    Control gridview =
     TextBox source_text =
       (TextBox) gridview.FindControl("log_nbr");
           if (source_text != null)

Passing data into a Sharepoint Designer Form Action workflow


I have a workflow that is triggered by a "Custom Action" on a "Form Action Button" that I added to a DataFormWebPart in SharePoint Designer. So the workflow isn't associated to any list or document library. What I need to do is pass some data to this workflow so that it can do some useful stuff.

I see from here that Natalya Voskresenskaya shows a method that allows you to pass a single list item value into a workflow variable but if you hack this into the aspx file as suggested, when ever you subsequently open design view and the workflow on the button again, all the hacks are removed by SPD.

I have tried this method and it seems to work for one variable, but I cant figure out how to pass more than one. Here is another post that is very similar but slightly different.

In this post Ibrahim said on April 1st 2008:

"I am having difficulty building a Javascript string for my particular requirement; SPD had already built a concat

Data Paging and passing variables to text box




Please help I am having troubles making the code run. I have a web page with a gridview and a checkbox. I would like the button when selected to pass the category id. I have managed to get it work without paging. Once the paging kicks in see below, I am unable to run the code. Please see below.






In the design: ASPX


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

passing data between views


I have a view, which contains data from a Model class.  In this view I have a <form> section and submit button, and using that to pass data to a controller works fine.  What I'm struggling with is using a link that I also have on this view which passes data to a different view if the user clicks on it.  I'm using HTML.ActionLink, and including a message, name of the view, and as the third parameter, the Model.  However, when I get to the called View, the Model is null.  Anyone know what's going on?


ViewData / Passing data


I have the following code.  When the View is rendered, I get "Object reference not set to an instance of an object" on the ViewData["Role"].  Not sure what I'm doing wrong...


        public int CheckUserRoles(string Username)
            int groupCheck = 1;

                using (DirectoryEntry de = new DirectoryEntry())
                    using (DirectorySearcher adSearch = new DirectorySearcher(de))
                        StringBuilder groupsList = new StringBuilder();
                        adSearch.Filter = "(sAMAccountName=" + Username + ")";
                        SearchResult result = adSearch.FindOne();

                        if (result != null)
                            foreach (string item in result.Properties["memberOf"])
                                var query = from role in db.Roles
                                            where role.Name == item
                                            select role;

                                if (query.Count() > 0)
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