Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dynamic change of ObjectDataSource parametersDynamic change of ObjectDataSource parameters
Previous
 
Next
New Post
3/12/2007 5:34 AM
 
Hi,

I use grid view in my own module to list certain entries from db.
One ObjectDataSource with one parameter is used. Parameter is being dynamically changed by clicking on LinkButtons, which are programatically added to page in a placeholder. Their names are loaded from DB (different ObjectDataSource).
Each LinkButton has its CommandName = "Filter" and CommandArgument = row("id_cat").toString

Everything is placed in Page_Load method.
Filter method looks like this:
Protected Sub Filter(ByVal src As Object, ByVal args As CommandEventArgs)
  ObjectDataSource_Tasks.SelectParameters.Item("UdSubType").DefaultValue = CType(src, Control).ID
  Me.GridViewUdalosti.DataBind()

But....
I've placed breakpoint in the top of the Page_Load method and debugger stops here only first time the page is loaded! Never more again...
After clicking one of the LinkButtons PostBack is called but breakpoint placed in Filter method is never achieved and ObjectDataSource parameters are not changed :(

What am I doing wrong?

Thanks a lot for advice!
 
New Post
3/12/2007 11:53 PM
 

Module caching maybe?


Do you know the truth when you hear it?
Néstor Sánchez
The Dúnadan Raptor -->Follow Me on Twitter Now!
 
New Post
3/13/2007 8:35 AM
 
Thanks a lot!
Now even breakpoints work properly.

But I'm still doing something wrong...After clicking any linkbutton, Page_Load is called and THEN Filter method. DataBind is called inside it but the content of the page is previously generated in Page_Load method and it is not updated after Filter method is called.

How can I do this, please?
 
New Post
3/13/2007 8:52 AM
 

Also you will want to wire-up to the ObjectDataSource selecting event like:

Protected Sub SetModuleId(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource_ThingsForSale.Selecting

    e.InputParameters("ModuleId") = ModuleId.ToString

End Sub

See this page for an example:

http://www.adefwebserver.com/DotNetNukeHELP/DNN_Things4Sale/ThingsForSale3.htm

 



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
3/14/2007 9:15 AM
 
I've used this guide while developing this module. Now I can see, it has been updated (was GuestBook module before).
I don't use any ModuleId parameter within my db tables or stored db porcedures  so I don't uderstand why should I place this method into my code. If I do so, it's called after every Page_Load but I don't know what shoul I place inside it :(
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dynamic change of ObjectDataSource parametersDynamic change of ObjectDataSource parameters


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out