Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Dropdownlist in Master Page

  Asked By: Daniel    Date: Jan 08    Category: Sharepoint    Views: 5385

I created a master page that looks like the typical Sharepoint site except
without the quick launch. What I want to do is to add a dropdownlist to the area
on the left hand side. In this dropdownlist I have some hyperlinks. I would like
to be able to click on one of the items in the DDL and go to that hyperlink. I
can place the DDL on the page but I don't understand where to put the
selectedindexchange code.

Share: 

 

27 Answers Found

 
Answer #1    Answered By: Ravindra Salvi     Answered On: Jan 08

You can do this with client-side JavaScript or with a server-side redirect
(means one extra HTTP request each time). Which would you prefer?

 
Answer #2    Answered By: Rahul Sharma     Answered On: Jan 08

Can you show me both ways?????

 
Answer #3    Answered By: Jagjit Phutane     Answered On: Jan 08

I should also mention that there's a third really easy way, which
is to use a third-party component like EasyListBox that has this built in
(and some nice formatting options to boot):
http://easylistbox.com/demoURLJump.aspx

...but on with the coding options. Option 1, the client-side JavaScript
approach:

1) Create a dropdownlist  and populate the Value of each item with the URL
you want to use.
2) add  a client-side event handler to the DDL (usually in your page  Load
sub, but you can do it with JS after the page loads if you prefer):

myDDL.Attributes.Add("onchange", "JumpTo(this)")

3) Create a JS function that does just that:

function JumpTo(theList) {
var sURL = theList.options[theList.selectedIndex].value;
window.location.href = sURL;
}

Option 2 -- the server-side approach -- is just about as simple. You create
the dropdownlist just like you would in step 1 above, but then you add a
server-side event handler instead (set AutoPostBack=True and then put  some
code into the OnSelectedIndexChanged event):

Sub myDDL_OnSelectedIndexChanged(Src As Object, E As EventArgs)
Response.Redirect(Src.SelectedValue)
End Sub

The sample code  is in VB because I didn't feel like typing a bunch of braces
and semicolons :) If you need more than that, just say the word. Another
advantage of option 1 (and option "pre-1") is that you don't need to whip
out Studio and compile -- or explicitly allow code behind -- just to test it
out.

 
Answer #4    Answered By: Janak Jadeja     Answered On: Jan 08

Here is what I have and it give me an error that says "Code blocks are not
allowed in this file"

<script language="javascript">
function ShowValue()
{
location.href = ddl.value;
}
</script>

<asp:DropDownList runat="server" id="ddl" Width="216px" Height="18px"
OnSelectedIndexChanged="ShowValue"> <asp:ListItem Value=""
Text="Departments" />
<asp:ListItem Value="http://www.google.com" Text="Google" />
</asp:DropDownList>

 
Answer #5    Answered By: Jude Alston     Answered On: Jan 08

Two things jump right out at me: first, your ShowValue function is
client-side JavaScript, not server-side VB/C#, so the page  should complain
that it isn't defined (since you've told the DDL to look for a server-side
event handler); second, the JS function has no idea what "ddl" is unless
you've defined it somewhere else.

Are you trying for option 1 or option 2 here?

 
Answer #6    Answered By: Araceli Eaton     Answered On: Jan 08

To tell you the truth all I want is for it to work. I don't care if it is option
one or two. The code  I sent you is from some web site. I am not very good with
code yet. I am just learning.

 
Answer #7    Answered By: Nisarg Kapadia     Answered On: Jan 08

I am a little confused, if you are adding this ddl to the master  page then you
should not see this error, its stored in the 12hive which has the rights to run
code blocks, unless you are using SPDesigner and are in a particular sub site
and have just customized the master of that sub site, if the second is true then
you need to go into the Web.Config file of the WSS instance on the IIS server
and a page  parser path to allow code  blocks to be allow to run under this site
see this link for that :

Top on is quick  link if you know what you are doing bottom one gives a
explanation of what this does read bottom one if you are unfamiliar with this
process

mysharepointblog.com/.../Running-Code-Blocks-In-Your-SharePoi\
nt-ASPX-Pages.aspx
weblogs.asp.net/.../SharePoint-2007_3A00_-using-ASP\
.NET-server-side-code-in-your-pages.aspx

Also did you get the two links I sent about adding code behind to master page?
If not here they are again

msdn.microsoft.com/en-us/library/cc411726.aspx
msdn.microsoft.com/en-us/library/bb986729.aspx

 
Answer #8    Answered By: Jaferry Khan     Answered On: Jan 08

Although the MasterPage is physically stored in the 12 hive it is accessed
through the address of the Masterpage gallery on the site. This will prevent
the page  from containing any inline server code  like the OnClick declaration you
added. See the following blog article for a potential fix.

blogs.msdn.com/.../how-to-allow-inline-code-in-un\
ghosted-master-pages.aspx

 
Answer #9    Answered By: Davin Knapp     Answered On: Jan 08

I'm still a bit confused because it doesn't look like there's any
server-side code  in the file.

 
Answer #10    Answered By: Deidra Best     Answered On: Jan 08

Since there is a <script> tag and since there is an attempt to wireup a
serverside event that doesn't exist in the compiled code
(OnSelectedIndexChanged="ShowValue") I suspect the parser tries to parse the
document looking for an inline method called ShowValue. I know it doens't
actually exist, but the fact that its referenced is I think enough to fire the
error.

 
Answer #11    Answered By: Rosalinda Merrill     Answered On: Jan 08

FIRST YOU SHOULD BUILD YOUR CONTROL IN ASP.NET (Visual Studios if
possible) TO ENSURE THAT IS WORKSSSS FIRST!!!!! THEN do the following:


Put this in your Web.Config file on your web front end server [typically you
would have to only add  the highlighted portion, into the Web.Config which is
typically stored @ c:\inetpub\wwwroot\wss\VirtualDirectories\80\Web.Config]:


<PageParserPaths>
<PageParserPath VirtualPath="/_catalogs/masterpage/*"
CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"
/>
</PageParserPaths>

Then in your master  page add the code  behind to top in head section in script
tags (if you are going to use any external namespaces such as the
Microsoft.SharePoint then you must add an assembly reference to the master page
see the highlighted code @ Import if not ignore them in this instance your
instance you should probably ignore them ):

<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities"
Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@
Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages"
Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome"
src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole"
src="~/_controltemplates/DesignModeConsole.ascx" %>

<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.WebControls" %>

<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server"
xmlns:o="urn:schemas-microsoft-com:office:office">
<HEAD runat="server">

<script runat="server">

//YOUR CODE BEHIND GOES HERE
Sub TheDDL_ID_MUST_MATCH _OnSelectedIndexChanged(Src As Object, E As EventArgs)
Response.Redirect(TheDDL_ID_MUST_MATCH.SelectedValue)
End Sub

</script>

<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder
id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<SharePoint:ScriptLink language="javascript" name="core.js"
Defer="true" runat="server" />
<SharePoint:CustomJSUrl runat="server" />
<SharePoint:SoapDiscoveryLink runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead"
runat="server"/>
<SharePoint:DelegateControl runat="server"
ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) !=
'undefined') _spBodyOnLoadWrapper();">
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">

The next and last step is to place  your control WITH matching event into the
master page  for display I would add this one just below the quicklaunch control:
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) !=
'undefined') _spBodyOnLoadWrapper();">
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
<WebPartPages:SPWebPartManager id="m" runat="Server" />
<TABLE class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%"
HEIGHT="100%">
<tr><td><asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation"
runat="server">
<table CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
<tr>
<td colspan=4 class="ms-globalbreadcrumb">
<!-YOUR CONTROL GOES INTO THE BODY OF THE MASTER PAGE SOMEWHERE -->
<asp:DropDownList runat="server" id="TheDDL_ID_MUST_MATCH" Width="216px"
Height="18px"
OnSelectedIndexChanged=" TheDDL_ID_MUST_MATCH _OnSelectedIndexChanged ">
<asp:ListItem Value=""
Text="Departments" />
<asp:ListItem Value="http://www.google.com" Text="Google" />
</asp:DropDownList>

I truly hope this helps you get a clearer picture of what you need to do and
remember to DO AN IIS reset afterwards

 
Answer #12    Answered By: Yogendra Zarapkar     Answered On: Jan 08

When I add  the code  in the web.config file:

<pageparserpath virtualpath="/_catalogs/masterpage/*" compilationmode="Always"
allowserversidescript="true" includesubfolders="true">

I get the error: 500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be
displayed.

 
Answer #13    Answered By: Jerad Mercado     Answered On: Jan 08

The article I passed was to explain why inline code  is prohibited on pages
served out of the content database. I don't recommend implementing he
pageparserpath fix that's in the article because it will let anyone who has
access to SharePoint designer put  code on the pages stored in the Masterpage
gallery. That's a very dangerous security loophole in my opinion.

 
Answer #14    Answered By: Riley Scott     Answered On: Jan 08

Yes, I agree with Paul I copied the code  straight over for simplicity, what you
would really want to do narrow down the page  parser path so say that you want to
just allow code on a specific site  you would add  this instead:

Example domain:

Mydomain.com/IT/CustomPage/Default.aspx<http://mydomain.com/IT/CustomPage\
/Default.aspx>

Your parser code would look like this:

<pageparserpath virtualpath="IT/_catalogs/masterpage/*" compilationmode="Always"
allowserversidescript="true" includesubfolders="true">

This should then only allow this specific subsites master  page to run the code.

 
Answer #15    Answered By: Adya Khavatekar     Answered On: Jan 08

Even if you get a limited page  parser path correctly configured, you will still
get an error on the page, just a different error. You are trying to hook a
client side  script to a server side event. You can't do that even if the page
is parsed.

The right way to do this is to create a server control with a dropdown list in
it, put  the server control on the page and the assembly with the code  for the
control in the appropriate place  (either the bin or the GAC). But that will
require some programming expertise that you have said you don't have. So I'm
afraid there is no easy way to do what you are trying to do without learning how
to write code. Copying code off a website or BLOG just isn't going to be
enough.

 
Answer #16    Answered By: Trupti Patil     Answered On: Jan 08

Ok forget trying to put  it in a masterpage. Can I put a dropdownlist  and the
associated script code  in a .aspx page? Here is what I tried:

<SCRIPT runat="server">
<!--
function switchpage(select) {
// JavaScript function for switching to web page  when user
// selects option from the given list box.

var index;

for(index=0; index<select.options.length; index++)
if(select.options[index].selected)
{
if(select.options[index].value!="")
window.location.href=select.options[index].value;
break;
}
}
// -->
</SCRIPT>

<asp:DropDownList runat="server" id="DropDownList1" OnChange="switchpage(This)">
<asp:ListItem Value="www.google.com">Google
</asp:ListItem>
</asp:DropDownList>

 
Answer #17    Answered By: Marlena Noble     Answered On: Jan 08

You can, but not the way you're doing it.

You're trying to hook up to a nonexistent server-side event (onchange),
using JavaScript (which probably isn't specified as the default language of
the page) without the proper .NET syntax for server-side event handlers.
Also, the JavaScript function that you're trying run server-side is actually
trying to manipulate client-side attributes.

Seriously, if you're not going to hire a developer or use a third-party
component, then you're going to have to start at the beginning and learn a
few things about ASP.NET development and/or JavaScript coding (depending on
your approach). There is a list called AspNetAnyQuestionIsOK at
tech.groups.yahoo.com/group/AspNetAnyQuestionIsOk/ that would be a
good place  to ask questions, and for JavaScript, you might try the evolt
list at http://lists.evolt.org/mailman/listinfo/javascript .

 
Answer #18    Answered By: Juan Davis     Answered On: Jan 08

You are trying to run JavaScript code  which is client side  code as if it where server side code!!! You
need to use just a basic html drop down control such as:

<select name="mydropdown" name="myDDL" onchange=" redirectToSomeWhere()">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>

Instead of [THIS IS A SERVER SIDE CONTROL SO YOU WOULD NEED TO USE EITHER C# OR
VB TO CONTROL IT NOT JAVASCRIPT]:

<asp:DropDownList runat="server" id="DropDownList1" OnChange="switchpage(This)">
<asp:ListItem Value="http://www.google.com" target="_blank" rel="nofollow">http://www.google.com" target="_blank" rel="nofollow">www.google.com">Google
</asp:ListItem>
</asp:DropDownList>

Here is a completed version of what you are asking for ALL done with client side
scripting [JavaScript] IN A master  page (SEE BELOW THE CODE YOU NEED TO add  TO
MASTER):

DO NOT NOT NOT COPY AND PASTE JUST ADD THE CODE YOU NEED TO (SEE CODE BELOW) YOU
WILL HAVE A BIGGER MESS I JUST WANTED YOU TO SEE WHERE I ADDED THE CODE TO IN
THE MASTER WITH THIS SECTION

<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities"
Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@
Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages"
Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome"
src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole"
src="~/_controltemplates/DesignModeConsole.ascx" %>

<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server"
xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
<HEAD runat="server">

////////////////////I ADDEDTHIS IN THE HEAD SECTION
OF THE MASTER
PAGE////////////////////
DO NOT COPY THIS CODE SEE BELOW WITH INSTRUCTIONS


<script type="text/javascript">
<!--
function RedirectToByDDL()
{
var _RedirectTo = document.aspnetForm.myDDL.value;

if (_RedirectTo.length > 0)
{
window.location = _RedirectTo;
}


}
//-->
</script>

<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder
id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<SharePoint:ScriptLink language="javascript" name="core.js"
Defer="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead"
runat="server"/>
<SharePoint:DelegateControl runat="server"
ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) !=
'undefined') _spBodyOnLoadWrapper();">
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">

///////////////I ADDED THIS JUST BELOW THE
FORM TAG IN THE MASTER
PAGE//////////////
DO NOT COPY THIS CODE SEE BELLOW WITH INSTRUCTIONS
<table><td><tr>

<select name="myDDL" onchange="RedirectToByDDL();">
<option value="">None</option>
<option value="http://http://www.google.com" target="_blank" rel="nofollow">http://www.google.com" target="_blank" rel="nofollow">www.google.com">Google</option>
<option value="http://www.yahoo.com" target="_blank" rel="nofollow">http://www.yahoo.com">Yahoo</option>
<option
value="http://www.microsoft.com" target="_blank" rel="nofollow">http://www.microsoft.com">Microsoft</option>
</select>

</tr></td></table>

<WebPartPages:SPWebPartManager id="m" runat="Server"/>
<TABLE class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%"
HEIGHT="100%">
<tr><td><asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation"
runat="server">
<table CELLPADDING=0 CELLSPACING=0 BORDER=0
WIDTH="100%">
<tr>
<td colspan=4 class="ms-globalbreadcrumb">
<span id="TurnOnAccessibility"
style="display:none">
<a href="#" class="ms-skip"
onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return
false;">
<SharePoint:EncodedLiteral runat="server"
text="<%$Resources:wss,master_turnonaccessibility%>"
EncodeMethod="HtmlEncode"/></a>
</span>
<A href="javascript:;"
onclick="javascript:this.href='#mainContent';" class="ms-skip"
AccessKey="<%$Resources:wss,maincontent_accesskey%>" runat="server">
<SharePoint:EncodedLiteral runat="server"
text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></A>
<table cellpadding=0 cellspacing=0 height=100%
class="ms-globalleft">
<tr>
<td class="ms-globallinks"
style="padding-top: 2px;" height=100% valign=middle>
<div>
<span id="TurnOffAccessibility"
style="display:none">
<a href="#" class="ms-acclink"
onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();return
false;">
<SharePoint:EncodedLiteral
runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>"
EncodeMethod="HtmlEncode"/></a>
</span>
<asp:ContentPlaceHolder
id="PlaceHolderGlobalNavigationSiteMap" runat="server">
<asp:SiteMapPath
SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap"
RenderCurrentNodeAsLink="true" SkipLinkText=""
NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
</asp:ContentPlaceHolder>
</div>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" height=100%
class="ms-globalright">
<tr>
<td valign="middle" class="ms-globallinks"
style="padding-left:3px; padding-right:6px;">
<SharePoint:DelegateControl runat="server"
ControlId="GlobalSiteLink0"/>
</td>
<td valign="middle" class="ms-globallinks">
<wssuc:Welcome id="IdWelcome" runat="server"
EnableViewState="false">
</wssuc:Welcome>
</td>
<td style="padding-left:1px;padding-right:3px;"
class="ms-globallinks">|</td>
<td valign="middle"
class="ms-globallinks">
<table cellspacing="0"
cellpadding="0">
<tr>
<td class="ms-globallinks">

<SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm"
runat="server"/></td>
<td class="ms-globallinks">

<SharePoint:DelegateControl ControlId="GlobalSiteLink2" Scope="Farm"
runat="server"/></td>
</tr>
</table>

I REMOVED THE REST OF THE MASTER SO DO NOT NOT NOT COPY AND PASTE JUST ADD THE
CODE BELOW IN THE CORRECT SPOTS


CODE SECTIONS THAT NEED ADDED TO MASTER page  COPY THIS AND ADD IT TO YOUR MASTER
PAGE:
Instructions:
Copy this section to the HEAD section of master page:

<script type="text/javascript">
<!--
function RedirectToByDDL()
{
var _RedirectTo = document.aspnetForm.myDDL.value;

if (_RedirectTo.length > 0)
{
window.location = _RedirectTo;
}
}
//-->
</script>

Instructions:
Add this table somewhere between the form tags of the master page:

<select name="myDDL" onchange="RedirectToByDDL();">
<option value="">None</option>
<option value="http://http://www.google.com" target="_blank" rel="nofollow">http://www.google.com" target="_blank" rel="nofollow">www.google.com">Google</option>
<option value="http://www.yahoo.com" target="_blank" rel="nofollow">http://www.yahoo.com">Yahoo</option>
<option
value="http://www.microsoft.com" target="_blank" rel="nofollow">http://www.microsoft.com">Microsoft</option>
</select>

 
Answer #19    Answered By: Jason Anderson     Answered On: Jan 08

Shane: that's not strictly true. You could use JavaScript to achieve the
same effect, even if you use an asp:DropDownList... but definitely not the
way it was set up there.

 
Answer #20    Answered By: Uttam Vanjare     Answered On: Jan 08

OK, Let's try to clarify this one, because there are actually TWO issues here
and we are each focusing on a different one.

1) Issue One - The original code  was a mix of client side  javascript and a
serverside event. You can't have a serverside event invoke client code. Shane
has provided code that transfers the whole thing to a client side code and
event. I haven't tested it, but it should work.

2) Issue Two - SharePoint does not allow the use of inline server side code on
any page  served up from the content database. The masterpage and aspx pages
uploaded to the system through the UI or SharePoint designer fall into this
category. So even if the original code where changed to be matching serverside
code and events the code wouldn't run. You can hack the system by changing the
page parser path, but this is a bad idea because it allows the inclusion of
unsecure code directly on a page.

The bottom line is that serverside code won't work without putting it into a dll
and javascript on the client is probably the best way to do this.

 
Answer #21    Answered By: Jack Carroll     Answered On: Jan 08

Or create a User Control............

 
Answer #22    Answered By: Chandrabhan Agarkar     Answered On: Jan 08

If its an ASPX page  that will be uploaded to the SharePoint content database you
are still going to have the same problem with inline code  that you have on the
masterpage. So no the code you listed below won't work.

 
Answer #23    Answered By: Lonnie Cohen     Answered On: Jan 08

The code  below just won't work, period.

If it were cleaned up to use only client-side script, then it would probably
be just fine for a master  page or a standard aspx.

 
Answer #24    Answered By: Ruchir Satam     Answered On: Jan 08

You have to match the
-------------virtualpath="/_catalogs/masterpage/*"---------------- property to
the subsite you are working on, this code  is just generic for demonstration
purposes, the error you are getting is an IIS level error

 
Answer #25    Answered By: Suresh Chindarkar     Answered On: Jan 08

As long as it works, right now I don't care how it is done. Can you show me how?

 
Answer #26    Answered By: Varun Mehta     Answered On: Jan 08
 
Didn't find what you were looking for? Find more on Dropdownlist in Master Page Or get search suggestion and latest updates.




Tagged: