Click here to Skip to main content
15,891,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionProblem with converting type Pin
Saba023-May-08 9:21
Saba023-May-08 9:21 
AnswerRe: Problem with converting type Pin
Hesham Amin3-May-08 10:14
Hesham Amin3-May-08 10:14 
GeneralRe: Problem with converting type Pin
Sunset Towers3-May-08 10:35
Sunset Towers3-May-08 10:35 
GeneralRe: Problem with converting type Pin
Christian Graus3-May-08 13:28
protectorChristian Graus3-May-08 13:28 
AnswerRe: Problem with converting type Pin
Blue_Boy3-May-08 13:38
Blue_Boy3-May-08 13:38 
AnswerRe: Problem with converting type Pin
Saba024-May-08 6:32
Saba024-May-08 6:32 
QuestionWebcontrol not displaying treeview [modified] Pin
Sunset Towers3-May-08 8:25
Sunset Towers3-May-08 8:25 
QuestionFormView ItemCreated problem Pin
AmirAlilou3-May-08 4:25
AmirAlilou3-May-08 4:25 
The following example demonstrates how to use the Row property to access the properties of the data row during the ItemCreated event.

<br />
<br />
<![CDATA[<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default6.aspx.vb" Inherits="Default6" %>]]><br />
<br />
<![CDATA[<%@ import namespace="System.Data" %>]]><br />
<br />
<script runat="server"><br />
  <br />
  Sub EmployeeFormView_ItemCreated(ByVal sender As Object, ByVal e As EventArgs)<br />
  <br />
    ' Use the Row property to retrieve the data row from <br />
    ' the FormView control.<br />
    Dim row As FormViewRow = EmployeeFormView.Row<br />
    <br />
    ' Get the data item bound to the FormView control.<br />
    Dim rowView As DataRowView = CType(EmployeeFormView.DataItem, DataRowView)<br />
<br />
    ' Set the ToolTip property of the data row. <br />
    row.ToolTip = rowView("FirstName").ToString() & " " & _<br />
      rowView("LastName").ToString()<br />
  <br />
  End Sub<br />
    <br />
</script><br />
<br />
<html><br />
  <body><br />
    <form id="Form1" runat="server"><br />
        <br />
      <h3>FormView Row Example</h3><br />
                       <br />
      <asp:formview id="EmployeeFormView"><br />
        datasourceid="EmployeeSource"<br />
        allowpaging="True"<br />
        datakeynames="EmployeeID"<br />
        onitemcreated="EmployeeFormView_ItemCreated"  <br />
        runat="server"><br />
        <br />
        <itemtemplate><br />
        <br />
          <table><br />
            <tr><br />
              <td><br />
                <asp:image id="EmployeeImage"><br />
                  imageurl='<%# Eval("PhotoPath") %>'<br />
                  alternatetext='<%# Eval("LastName") %>' <br />
                  runat="server"/><br />
              </asp:image></td><br />
              <td><br />
                <h3><![CDATA[<%# Eval("FirstName") %>]]> <%# Eval("LastName") %></h3>      <br />
                <%# Eval("Title") %>        <br />
              </td><br />
            </tr><br />
          </table><br />
        <br />
        </itemtemplate><br />
          <br />
      </asp:formview><br />
          <br />
      <!-- This example uses Microsoft SQL Server and connects  --><br />
      <!-- to the Northwind sample database. Use an ASP.NET     --><br />
      <!-- expression to retrieve the connection string value   --><br />
      <!-- from the Web.config file.                            --><br />
      <asp:sqldatasource id="EmployeeSource"><br />
        selectcommand="SELECT [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] FROM [Employees]"<br />
        connectionstring="<%$ ConnectionStrings:NorthwindConnectionString %>" <br />
        runat="server"/><br />
            <br />
    </asp:sqldatasource></form><br />
  </body><br />
</html><br />
<br />
<br />


but when i run it an exception accured Object reference not set to an instance of an object.

i don't know what is problem


thanks
AnswerRe: FormView ItemCreated problem Pin
Christian Graus3-May-08 13:27
protectorChristian Graus3-May-08 13:27 
GeneralRe: FormView ItemCreated problem Pin
AmirAlilou3-May-08 20:07
AmirAlilou3-May-08 20:07 
GeneralRe: FormView ItemCreated problem Pin
AmirAlilou4-May-08 18:35
AmirAlilou4-May-08 18:35 
GeneralRe: FormView ItemCreated problem Pin
AmirAlilou3-May-08 21:16
AmirAlilou3-May-08 21:16 
GeneralRe: FormView ItemCreated problem Pin
Christian Graus4-May-08 11:36
protectorChristian Graus4-May-08 11:36 
QuestionAJAX Control Toolkit - Accordion Pin
Yaniv___3-May-08 3:46
Yaniv___3-May-08 3:46 
AnswerRe: AJAX Control Toolkit - Accordion Pin
Sam Xavier8-May-08 19:42
Sam Xavier8-May-08 19:42 
AnswerRe: AJAX Control Toolkit - Accordion Pin
Bit-Smacker4-Jun-08 6:48
Bit-Smacker4-Jun-08 6:48 
QuestionForm view in Asp.Net Pin
kumarrpt3-May-08 1:34
kumarrpt3-May-08 1:34 
AnswerRe: Form view in Asp.Net Pin
Christian Graus3-May-08 1:37
protectorChristian Graus3-May-08 1:37 
Questionrelationship in sql??? Pin
mr.mohsen3-May-08 1:02
mr.mohsen3-May-08 1:02 
AnswerRe: relationship in sql??? Pin
Christian Graus3-May-08 1:05
protectorChristian Graus3-May-08 1:05 
GeneralRe: relationship in sql??? Pin
Hesham Amin3-May-08 10:20
Hesham Amin3-May-08 10:20 
GeneralPassword Hashing Pin
Brady Kelly3-May-08 0:37
Brady Kelly3-May-08 0:37 
GeneralRe: Password Hashing Pin
Christian Graus3-May-08 1:16
protectorChristian Graus3-May-08 1:16 
GeneralRe: Password Hashing Pin
Brady Kelly3-May-08 2:12
Brady Kelly3-May-08 2:12 
Questionpdf file and exe Pin
bigphish3-May-08 0:15
bigphish3-May-08 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.