עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

שאלה לגבי GRIDVIEW

Featured Replies

פורסם

שלום לכולם

רציתי לשאול: אם יש לי GRIDVIEW וכל שורה בGRIDVIEW יש נתיב של קובץ ,אני רוצה לדעת איך לוקחים את הנתיב ומכניסים לתוך משתנה STRING

תודה מראש

פורסם

יש את המחלקה Path. אולי היא תעזור לך.

פורסם


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Files.aspx.cs" Inherits="CFiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/url]
<html xmlns="[url]http://www.w3.org/1999/xhtml"[/url] >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DSFilesTableAdapters.T_FILESTableAdapter"></asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="NAME" HeaderText="NAME" SortExpression="NAME" />
<asp:TemplateField HeaderText="Link To File">
<ItemTemplate>
<asp:HyperLink ID="Link1" runat="server" Text='<%#Eval("NAME")%>' NavigateUrl='<%#Eval("PATH")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</form>
</body>
</html>

ObjectDataSource1 מפעיל DataAdapter שמוגדר בתוך DataSet ה- DataAdapter קורא ל- Stored Procedure ב- DB ובו משפט select פשוט של למשל שם קובץ ונתיב לקובץ , כאשר הנתיבים לקבצים נשמרים בתחביר של הפניה יחסית כך:

ID NAME PATH

1 File 1 ~/Documents/1.xls

3 File 2 ~/Documents/2.doc

4 File 3 ~Documents/3.pdf

NULL NULL NULL

כפי שאמרתי אין צורך לכתוב אף שורת קוד אחת

תקרא על DataSets ואיך מגדירים אותם , זה ממש פשוט

ואיך כותבים Stored procedure שזה גם ממש לא מסובך

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.