Editurl And Navigateurl
ViewDnnOfCode.EditurlFor example, the most common function that can be edited isItemThere is a pen in front, and click it to jump to the editing page:
Asp : hyperlink navigateurl = ' <% # editurl ("Itemid ", databinder. eval (container. dataitem, "Itemid ")) %> ' visible =" <%< /span> # iseditable %> " runat =" server " id = "hyperlink1"> Asp : image id = hyperlink1image runat = server imageurl = "~ /Images/edit.gif " alternatetext =" edit " visible = " <% # iseditable %> " resourcekey = "edit"/> Asp : hyperlink
EditurlMainly to jumpEditPage, of course, it can also jump to otherControlPage. It is in the module base classPortalmodulebase. It is overloaded.5Time, which can be left blank orPublic FunctionEditurl (ByvalKeynameAs String,ByvalKeyValueAs String,ByvalControlkeyAs String,Byval ParamarrayAdditionalparametersAs String())As String
It is in the base class of the module and is easy to use. It is also one of the functions with a high output rate.
It callsGlobal. VBMediumNavigateurlFunction. This isStaticFunction.NavigateurlCallGlobal. VBInFriendlyurlFunction.ProviderTo load the correspondingDnnfriendlyurlprovider
Dotnetnuke. Services. url. friendlyurl. friendlyurlprovider. instance (). friendlyurl (tab, path, pagename, portalalias)
Application
InDnnIn the development process, you often need to jump to the page, and the following provides solutions for different occasions (the main purpose of the following description isURLHow to generate a string ):
(1)Two or more modules are defined in the module definition.Control, FromControlThe page jumps to another page.
The same module, differentControlAnd does not involve parameter transfer.Editurl (controlkey)
(2)In many cases, we need to input some parameters, especiallyItemidIn the receiving module, this parameter is extracted for judgment. For exampleBlogModule:
DefinedView_entry Control, You may needView blogYou can useEditurl ("Itemid "," 123" , View_entry)Method.
The same module, differentControlAnd involves the transmission of a parameter, you can use
Editurl (keyname, keyValue, controlkey), If yesEdit ControlCan be omitted
Editurl (keyname, keyValue)
(3)In some cases, we may need to pass more parameters.Editurl (keyname, byval keyValue, controlkey, byval paramarray additionalparameters as string ())
The final parameters can be listed, such
Editurl ("caterogycode "," 123" , "Viewdetail", "storeid "," 431" )
It means jumpViewdetail ControlPage, whereCaterogycode= 123,Storeid = 431.And so on.
(4)If we wantTabFor example, I want to jump to the home page or a knownTabidThe page can beNavigateurl (byval Tabid as integer)
The following code helps redirect"Product"Page:
Tabcontroller ctltab = New Tabcontroller ();
Tabinfo objtab = Ctltab. gettabbyname ( " Product " );
This . Response. Redirect (globals. navigateurl (objtab. Tabid ), True );
(5)
Most flexible
Public FunctionNavigateurl (ByvalTabidAs Integer,ByvalIssupertabAs Boolean,ByvalSettingsAsPortalsettings,ByvalControlkeyAs String,Byval ParamarrayAdditionalparametersAs String())As String
Function.ControlkeyAndNMultiple additional parameters.
To sum up the above two functions:
Different in the same moduleControlBetween, you can useEditurl.
In differentTabInter-hop usageNavigateurl.
Both of them can pass several parameters.
neither of these functions can change the final aspx file name, however, globals. VB friendlyurl path Custom, change *. aspx . It has more flexibility, but is rarely used.