|
I found this code at msdn site explaining how to make a master/detail view:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebteam/html/webteam02052002.asp
The code is listed below.
musicLibrary.xml
<Artists>
<Artist name="The Chipmunks">
<CD id="4550" name="Eponymous" image="Eponymous.jpg" />
<CD id="4557" name="Hibernation" image="Hibernation.jpg" />
<CD id="4577" name="Going Nuts" image="GoingNuts.jpg" />
</Artist>
<Artist name="The Dogs">
<CD id="4640" name="Full Moon" image="FullMoon.jpg" />
<CD id="4637" name="Old Shoes" image="OldShoes.jpg" />
<CD id="4664" name="My House" image="MyHouse.jpg" />
</Artist>
</Artists>
music.aspx
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<html>
<script language="VB" runat="server">
Dim DS As Dataset = New DataSet
Sub Page_Load(Src As Object, E As EventArgs)
DS.ReadXml(Server.MapPath("musicLibrary.xml"))
Dim CSource As DataView
CSource = DS.Tables("Artist").defaultView
MusicList.DataSource = CSource
'a little code to help display what table relations exist
RelationsGrid.DataSource=DS.Relations
DataBind()
End Sub
</script>
<body>
<ASP:Repeater id="MusicList" runat="server">
<ItemTemplate name="ArtistTemplate">
<br /><br /><b><%# Container.DataItem("name") %></b><br />
<ASP:Repeater id="CDList" runat=server
datasource='<%# Container.DataItem.CreateChildView("Artist_CD")%>'>
<ItemTemplate name="CDTemplate">
<img src="<%# Container.DataItem("image") %>"align="absmiddle"/>
<%# Container.DataItem("name") %><br />
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</ASP:Repeater>
<br /><br />
<ASP:DataGrid id="RelationsGrid" runat="server"
Width="300"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
MaintainState="false"
/>
</body>
</html>
My problem is that it uses an xml file as a datasource.
Where i want to use two related tables from a database, but i can't seem to figure out how to do that.
I have created a dataset containing the two tables, I have also created a datarelation between the two tables.
I am able to write out the master table if i remove the nested repeater control.
If anyone is able to solve this problem i think a lot of people would be grateful. as i've seen questions
about this master detail thing around the net.
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
New (relatively) to .Net , and I've got a quick question:
Is it possible (and if so, a hint would be appreciated...) to have separate config files or separate config file sections for a number or custom user controls?
for example, say I've got a page with a "Latest News Display" control as well as a "User Poll" control. I'm looking to store things like the db connection strings in a "web.config" file.
Barking up the wrong tree or just a bit slow?
TIA.
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
|
Beauty! Thanks much..
(So does that prove that I was just "SLOW"?)
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
Nah it just proves MS loves to hide stuff in their vast ocean of documentation..
|
|
|
|
|
Is there anyway to display an ActiveX in Netscape browser? Usual OBJECT tags doesn't seem to be working there (using NS 6.2)
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
ActiveX isn't supported in Netscape. I'm certain of this in 4.x, and I'm willing to bet this is also the case in 6.x. ActiveX is a Microsoft technology and is not an industry standard.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
Hmm... kinda strange, OBJECT tag is in HTML 4 specification and it has "classid" attribute. From my point of view of Windows programmer, class id means GUID of the COM/ActiveX object.. But Netscape says it support HTML 4 in NS6 (incl. OBJECT tag), but looks like I can't use ActiveX GUID in it. So I can think about 2 ways - Netscape lies and it doesn't support HTML4, or "classid" is something else and not what I'm thinking. Then what is "classid" in Object tag?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Philip Patrick wrote:
or "classid" is something else and not what I'm thinking. Then what is "classid" in Object tag?
A class id generally is a GUID but doesn't have to be in theory. This is not related to ActiveX other than the controls use them. Support for the object tag doesn't mean ActiveX support. Other instances of using the object tag would be for RealAudio/Video, Flash, etc. It's still up to the user agent (e.g.; Netscape) to interpret the object data. Ever notice you have to install plug-ins for Real and Flash? It's processed by the browser. The HTML specification doesn't cover this.
Hope that helps.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
Is there a way to set the focus to a particular control, like an edit box, on a server page when it loads?
Thanks,
Marc
|
|
|
|
|
Server page? It is a client task.
You can create a javascript which will set focus to control. Like in onload handler of the body tag:
document.getElementById("myeditbox").focus();
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Sorry for such a simple question but I can't figure it out.
In my ASP code I get Some HTML code from some COM server then I try to find some string, say "something" in that HTML and InStr fails because it actualy is looking for "s o m e t h i n g " in there and of course can't find it. How do I tell ASP code to use regular strings?
|
|
|
|
|
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))
* From MSDN Library
|
|
|
|
|
This is different. you are looking "ASP" string in "ASP" string. And ASP
is using unicode. But my problem is different. I get regular, non unicode string from a control and then attempt to find something in that non unicode string and I can not because in fact under the hood it is looking for
"c 0 c 0 c 0" when in that non unicode string there is "c0c0c0". So how do I tell ASP to use regular strings in comparisons or how do I convert that non unicode string to unicode before searching?
|
|
|
|
|
|
Somedays before , I met a strange thing that my IIS stop working itself.I must reboot the system,then it worked again! who can tell me the reason?
My system is win2000 Chinese-simple and IIS is Ver5.0。
thanks a lot!
we can help together in web desingn ?
|
|
|
|
|
|
I have installed SDK and Microsoft.Web.UI.WebControls.
Did a small asp.net to test the tree view control and getting the following error
"Could not load type Microsoft.Web.UI.WebControls.BasePostBackControl from assembly Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35."
Can someone please tell me what is happening here.
Tharanga
|
|
|
|
|
it said that the website is opensource,
but when i download the full project and run it on my pc.
it did not display as the website.
but display 2eNetWorX website.
what's the matter!
does anyone use the source?
thanks!
|
|
|
|
|
How come the folowing code doesn't work?:
<asp:datalist id="DataList1" runat="server">
<itemtemplate>
<%# Container.DataItem("model") %>
But this code works fine:
<asp:datalist id="DataList1" runat="server">
<itemtemplate>
<%# DataBinder.Eval(Container.DataItem, "model") %>
Do you have any ideas???
Thanks.
Steffen Otto Jensen
Denmark.
|
|
|
|
|
hmm... theres some code missing... the two lines of code should sit in a datalist...
|
|
|
|
|
to begin with, still relative newbie to asp here
i'm tryin to make a reminder page, you know, for appoinments, birthdays etc
when the page loads txtRealDate gets the current date how do i read the value of say, txtRealDate and subtract from it the value of a combobox, and show the result in txtWarnDate. any helps really appreciated.
shotgun
|
|
|
|
|
1st it depends on if you're using ASP classic or ASP.NET The logic is basically the same but the syntax is way different.
If classic then see DateValue() and DateAdd()
If ASP.NET see System.DateTime
The methods in particular are:
Parse()
Add()
AddDays()
AddHours()
AddMilliseconds()
AddMinutes()
AddMonths()
AddSeconds()
AddTicks()
AddYears()
(Take your pick )
|
|
|
|
|
I want to add a contact page to my site that allows users to contact me with questions. The form would ask them to enter there Name/Email Address/Phone Number and Message.
Help. Thank you in advance.
sdukart
|
|
|
|
|
I have been using the sample indexserver.asp and modified it a bit, but I can't seem to get "Summary" to work. What I mean by summary is after the Link/URL/File I want a Summary listed below each result so that a searcher can preview each link before clicking on it.
Help. Thank you in advance.
sdukart
|
|
|
|