CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.custom_modules Tags:
Item Type: Date Entered: 2/28/2005 4:47:25 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 28 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
"xzg3" <>
NewsGroup User
What is the best way to pass parameters to a module instance directly through a query string? (to bypass rendering the HTML of DesktopDefault for example)2/28/2005 4:47:25 PM

0

What is the best way to pass parameters to a module instance directly through a query string?

For example,
I want to make a module that is capable of fetching some data from a URI, then reformat that data so that it is RSS compliant. I also want to make this instance of the module capable of publishing itself as RSS, so that if a user triggered a specific event within that module, then the DotNetNuke page would not be displayed, but instead the RSS content would be shown.

I've noticed that in ResDirMgr (3.2) from Santry the link is directly to the page:

sitename/Default.aspx?tabid=41&type=rss&qry=&lcl=2&typ=1&sort=SiteName&ord=Asc&parentid=1

But on his own page, he features a different approach:

http://www.wwwcoder.com/main/DesktopModules/ResDirMgr/ASPSearch_Options.aspx?tabid=68&action=cat&parentID=474&xml=rss&mid=407&ord=Desc&by=SiteArticle%20Desc,%20SponsorID

Any thoughts on what is the best approach and drawbacks/positives to each?

Thank you,
Josh
ASP.NET/C# Developer
"wwwcoder" <>
NewsGroup User
Re: What is the best way to pass parameters to a module instance directly through a query string? (to bypass rendering the HTML of DesktopDefault for example)2/28/2005 8:24:04 PM

0

I don't know about positives and negatives. WWWCoder.com is my testing ground, I do my proof of concept stuff there, if it works out then I'll put it into my module.

I prefer the first method, this does not require any special aspx pages, it uses standard module architecture provided by DNN. Since everything is done within the framework it is easier to implement any DNN methods like security, portal configuration, etc. Basically, I just stop the request, change the mime type, and output my RSS within the module code.
WWWCoder.com
Redmond Gadgets
My Weblog
"xzg3" <>
NewsGroup User
Re: What is the best way to pass parameters to a module instance directly through a query string? (to bypass rendering the HTML of DesktopDefault for example)2/28/2005 9:25:29 PM

0

Ok, thanks Patrick. I will look more in depth at the code and try the same thing for mine.
-Josh
ASP.NET/C# Developer
"xzg3" <>
NewsGroup User
Re: What is the best way to pass parameters to a module instance directly through a query string? (to bypass rendering the HTML of DesktopDefault for example)3/1/2005 4:30:00 AM

0

Patrick, I looked through your code and saw how you did it and got some ideas.

This is what I came up with.

The "Dispatch" module just inspects the query string and if it finds the uvcmid param, it calls the same methods that the module instance would eventually call if fully rendered:

I guess I could do this on a separate .aspx page too if needed.

public class UVcWebTransformRSSDispatcher : PortalModuleControl {

protected Label RSSDispatcherMonitor;

protected override void OnInit(EventArgs e)
{
// Check whether the query string contains a parameter for a module instance.
// If it does, load up a UVcWebTransformParameters instance with the settings
// from the database and call Execute the transformation.
try {
int ModuleId = System.Int32.Parse(Request.QueryString["uvcmid"].Trim());
Hashtable h = PortalSettings.GetModuleSettings(ModuleId);
UVcWebTransformParameters uvp = new UVcWebTransformParameters(h, Response);
string rv = UVcWebTransformPerformTransform.Execute(uvp);
// Assume valid RSS returned from execution
Response.Clear();
Response.ClearHeaders();
Response.ContentType = "text/xml";
// Fake it for now:
Response.Write("<rss>\nthis is my rss for: " + (string) h["DataSourceURI"] +
"<content>\n<![CDATA[" + rv + "\n]]>\n</content>\n</rss>");
Response.End();
} catch (Exception ex) {
RSSDispatcherMonitor.Visible = true;
RSSDispatcherMonitor.Text = "Unable to process request due to an error:<br />" + ex;
base.OnInit(e);
}
}
}

ASP.NET/C# Developer
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:













new book on visual web developer express 2008

web application projects

using the split feature

vwd 2008 compatibility with vwd 2005?

when orcas express beta1 will release

missing menus

is it worth it

want to upgrade the website to be used with . net framework 3.5?

materpage problem

should i uninstall previous ctps before installing orcas ctp?

'view in browser' - error: can't display the web page

cannot open sql file in visual web developer after the registration.

adavantages of using visual web dev over plain tex editor(notepad)

does linq work with express edition visual web developer 2008?

how to learn vb vwd2008. any good books

linqtosql, linqtoxml item template

using visual sourcesafe 2005 with visual web developer 2008 express

vwd 2008 and silverlight 2

recently purchased visual studio 2005 professional!

parser error "caused" by vwd2008

adding ajax toolkit into visual web developer 2008 express

issues with jpg's in preview

problem installing visual web developer express 2008 on windows vista

alternative to ftp and frontpage?

upgrading from 2005

update to vwd2008? should?

vwd express 2008 markup error in master page - worked fine in vwd express 2008 beta -

license and distribution of software created in vwd

can you choose the runtime version when creating a new project?

how to add reportviewer in visual web developer 2008 ?

event handlers don't appear.

error creating control

vwd 2008 manipulating sql database

datapager what does it do?

unable to connect to local web server

beta 2 is here!!!

performance and memory issues with beta 2

vwd 2008 server error

?? on relative label placement in vwd 2008 express

web.config file crashing my vwd 2008/.net 3.5 framework site?

vwd2008 webpublishing

where are the tools?

can't add ajax extensions 1.0 to vwd 2008 toolbox

can i create components (dll:s) in vwd?

just-in-time, error crashes my iexplorer 6

changing login database

a question about microsofts positioning of vwd and expressions

where are the mobile controls?

what happened to my css intellisense in vwd 2008 express?

asp.net runtime error: child nodes not allowed?

   
  Privacy | Contact Us
All Times Are GMT