S
Sky
Basically, I'm stumped on how to translate something I wrote in PHP to
ASP.NET, and I'm having a hard time figuring out what is right way to do it
now...
The scenario in PHP was as follows:
I wrote a Discussion forum that worked client side via JScript that
initiated home-brew RPC calls in XML format (I wrote it pre-soap, or -- more
precisely -- before I knew about SOAP...) something like:
<rpc><command>GetChildren</command><msg_id>1478</msg_id></rpc>
Which was responded to with:
<recordset>
<record><Subject>aljfaslkfj</Subject><Msg>sdfasdfas</Msg></record>
<record><Subject>aljfaslkfj</Subject><Msg>sdfasdfas</Msg></record>
....
</recordset>
Upon receipt I used JScript to insertRow() and manipulate the layout...
As for editing/viewing single records, I simply hide the div that contained
the tree, and showed another div that I also dynamically filled in. Submit
was also done via XML.
Pretty straightforward trying to be Flash within HTML........ ;-)
Other than being a fun challenge of packing lots of JScript into 14k, the
benefit of such an approach was that no vars needed to be held in Session as
each XML call caused only one Query (Select * from Msgs where PID=@...) and
that was that.
The downside of couse was that if you F5, you recollapsed the tree.... But
all in all, it was pretty smooth, very little data on the wire so quick
response times, etc. The only tough part was the wiring across frames or div
hiding/displaying (I used both techniques) for the edit forms...But ok.
Now -- in ASP.NET - and please bear with me, I just started ASP.NET a couple
of months ago, and I'm still 'thinking' in PHP mode it seems, but I really
want to learn -- I'm tried to figure out how to handle this within the DNN
structure.
For one, if I use an EditForum.aspx on another page/url, and then return to
the forum, to not completly lose the layout of the tree, I have to either a)
Query recursively each time someone clicks a leaf to expand its children
(ie, 3 nodes down, we're talking about 3 queries in stead of 1) or b)hold a
proxy tree to which I append the new sub-query, then hold that proxy-tree in
Session or in memory, or in ViewState.
Saving it in ViewState sounds horrible as I would be burying the Client
under 30 records (visible) and 30 records (stuffed in ViewState). And that
was for a small set -- if I had a tree with 1, 1.5, 1.7, 1.5.3, 1.7.4 open,
then we're talking about 5 queries...Lots of time Querying, lots of time
serializing, lots of time and transfer size everywhere...
Saving it in Session via rerouting the ViewState to Session (I had read the
same article you referred to btw) sounds ok for about 200 users, but keel
over after that (100 users * 50k = 100Megs) because -- if I understand
correctly, DNN's Session data is in memory -- not transfered to file/DB) ...
I hadn't even realized that the session stuff was still in memory for
another 20 minutes or so, as your blog made clear!
Or manually saving it to a file by hand -- which (let alone the nightmare of
cleaning up after myself, creating unique names, etc) depends on the
security Write settings of the dir where DNN (the website portal system i am
attempting to write this for) was installed....
Anyway -- this all seems way too difficult to be the correct way to be
approaching this in ASP.NET, so I'm reaching out to see if you have a
suggestion on how to perceive the solution from ASP.NET eyes, to keep a
forum, with some child nodes opened, some not, and yet not require millions
of Queries to rehydrate the tree on each click...
Thanks!
Sky
ASP.NET, and I'm having a hard time figuring out what is right way to do it
now...
The scenario in PHP was as follows:
I wrote a Discussion forum that worked client side via JScript that
initiated home-brew RPC calls in XML format (I wrote it pre-soap, or -- more
precisely -- before I knew about SOAP...) something like:
<rpc><command>GetChildren</command><msg_id>1478</msg_id></rpc>
Which was responded to with:
<recordset>
<record><Subject>aljfaslkfj</Subject><Msg>sdfasdfas</Msg></record>
<record><Subject>aljfaslkfj</Subject><Msg>sdfasdfas</Msg></record>
....
</recordset>
Upon receipt I used JScript to insertRow() and manipulate the layout...
As for editing/viewing single records, I simply hide the div that contained
the tree, and showed another div that I also dynamically filled in. Submit
was also done via XML.
Pretty straightforward trying to be Flash within HTML........ ;-)
Other than being a fun challenge of packing lots of JScript into 14k, the
benefit of such an approach was that no vars needed to be held in Session as
each XML call caused only one Query (Select * from Msgs where PID=@...) and
that was that.
The downside of couse was that if you F5, you recollapsed the tree.... But
all in all, it was pretty smooth, very little data on the wire so quick
response times, etc. The only tough part was the wiring across frames or div
hiding/displaying (I used both techniques) for the edit forms...But ok.
Now -- in ASP.NET - and please bear with me, I just started ASP.NET a couple
of months ago, and I'm still 'thinking' in PHP mode it seems, but I really
want to learn -- I'm tried to figure out how to handle this within the DNN
structure.
For one, if I use an EditForum.aspx on another page/url, and then return to
the forum, to not completly lose the layout of the tree, I have to either a)
Query recursively each time someone clicks a leaf to expand its children
(ie, 3 nodes down, we're talking about 3 queries in stead of 1) or b)hold a
proxy tree to which I append the new sub-query, then hold that proxy-tree in
Session or in memory, or in ViewState.
Saving it in ViewState sounds horrible as I would be burying the Client
under 30 records (visible) and 30 records (stuffed in ViewState). And that
was for a small set -- if I had a tree with 1, 1.5, 1.7, 1.5.3, 1.7.4 open,
then we're talking about 5 queries...Lots of time Querying, lots of time
serializing, lots of time and transfer size everywhere...
Saving it in Session via rerouting the ViewState to Session (I had read the
same article you referred to btw) sounds ok for about 200 users, but keel
over after that (100 users * 50k = 100Megs) because -- if I understand
correctly, DNN's Session data is in memory -- not transfered to file/DB) ...
I hadn't even realized that the session stuff was still in memory for
another 20 minutes or so, as your blog made clear!
Or manually saving it to a file by hand -- which (let alone the nightmare of
cleaning up after myself, creating unique names, etc) depends on the
security Write settings of the dir where DNN (the website portal system i am
attempting to write this for) was installed....
Anyway -- this all seems way too difficult to be the correct way to be
approaching this in ASP.NET, so I'm reaching out to see if you have a
suggestion on how to perceive the solution from ASP.NET eyes, to keep a
forum, with some child nodes opened, some not, and yet not require millions
of Queries to rehydrate the tree on each click...
Thanks!
Sky