Category Archives: XmlDataSource

XmlDataSource

[RESOLVED]Ajax AdRotator and Page load behavior

Hello, When page refreshes due to time trigger, page focuses on that updated page portion, which is annoying. Please see this behavior here: (scroll page and you will be redirected to the same "Also Available On" section, I don’t want that): http://www.usmaniacomplex.com/Downloads/UCL_1_0.aspx and http://www.usmaniacomplex.com/Downloads/UKM_1_0.aspx . 

Code:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>

        // Comments panel

   </ContentTemplate>

</asp:UpdatePanel>

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
   <ContentTemplate>
        <asp:AdRotator ID="AdRotator1" runat="server" Target="_self" DataSourceID="XmlDataSource1" />
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/some.xml"></asp:XmlDataSource>
        <asp:Timer ID="Timer1" runat="server" Interval="2000"></asp:Timer>
   </ContentTemplate>
</asp:UpdatePanel>

See if this helps you: http://forums.asp.net/t/1156877.aspx

http://forums.asp.net/t/1513472.aspx

Specifically the post with this snippet:

<script type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(beginRequest);
function beginRequest() {     prm._scrollPosition = null; } < /script>

http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

<pages smartNavigation="true"MaintainScrollPositionOnPostback="true"/>

http://basgun.wordpress.com/2008/06/09/maintain-scroll-position-updatepanel-postback/

[RESOLVED]Anchor text on target page

 

Hi!

I’ve got a page with anchord urls, the problem is on the target page. The control adds the text belows to controlID so the text don’t match the anchord text.

 DefaultMasterContent_ctl00_repBigPageContent_

Dim text As New Label
            text.ID = removeUrlChar.RemoveCharFromUrl(PageContentInfo.PageTitle)
            text.Text = PageContentInfo.PageTitle

            Dim panel As Panel = CType(e.Item.FindControl("Panel1"), Panel)
            panel.Controls.Add(text)

The panel is added to a repeater.

Any solution to the problem or other suggestions

Change the ClientIDMode of the control to "Static". 

Example:

<asp:ListView ID="ListView1"
              ClientIDMode="Static"
              DataSourceID="XmlDataSource1" runat="server" >
</asp:ListView>

Documentation here: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx

and here: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx

[RESOLVED]Dynamically populate Title Tag and Meta Tags with xml

Hello everyone,

Yes, I’m back and still teaching myself C# programming, of course with the help of you guys and gals here. You guys should be proud I am really progressing, however, I am stumped with how to dynamically populate my title tag, meta description and keyword
tags. The website program I am developing, I have developed an .aspx page creator that sends data to an xml document to populate the new page. I am using a DataList with an xmlDatasource control to populate the new pages contents. I’ve quickly learned you
cannot use a Datalist in the Head Tags of the page. I am familiar with the simple code behind code below in 4.0, but how do I retrieve the nodes of an xml datasource and populate each tag below…

<div class="line alt1">

Page.Title = "How to dynamically populate this with xml";
Page.MetaDescription = "Same here";
Page.MetaKeywords = "…and here";

I’ve tried quite a few different ways, but to no avail. Any suggestions anyone can offer will be greatly appreciated.

I may not submit a lot of questions, but I have found a lot of answers to questions I’ve had through this forum. THANK YOU! THANK YOU! THANK YOU! to you ALL!

</div>

[RESOLVED]Treeview loading complete

Once asp.net tree view is rendered in a page is there any event to access it without waiting for document.ready event of a same page?

You can set display:none for treeview and show it in document.ready

OR

put your script just below treeview code to access it

I am adding a tree control dynamically to a page then should I add page.registerclient script(this,"custom.modifytreePeoperties()" Will this get executed before document.ready()?

Can you show us your full codes?

Page load

XmlDataSource explorerdatasource = new XmlDataSource();
            explorerdatasource.EnableCaching = false;
            explorerdatasource.ID = "explorerdatasource";
            explorerdatasource.Data = results;
            treeControl.TreeNodeDataBound +=new TreeNodeEventHandler(treeControl_TreeNodeDataBound);
            treeControl.EnableViewState = false;
            treeControl.DataSource = explorerdatasource;
            treeControl.DataBindings.Add(new TreeNodeBinding() { DataMember = "Node", TextField = "Text" });
            treeControl.DataBind();
            divControl.Controls.Add(treeControl);

Hi again,

Do you wanna execute js after the TreeView is fully data-bound?

Yes that’s correct, I need to execute js after treeview is loaded and fully databound.

mux.work

Yes that’s correct, I need to execute js after treeview is loaded and fully databound.

Hi,

You can write the codes after the TreeView_DataBound event:

ClientScriptManager.RegisterStartUpScript(……);

[RESOLVED]bind data to gridview

Hi, I ve some queries that return information from multiple tables and I want to bind the results to a gridview but I don’t know how to to put every result in a column and also how to add <img/> to the imageUrl.

I’m new in .net, This what I used to do in php and how I want data to diplay:

using (var context = new DonationEntities())
            {

                var dons = from i in context.images
                           where i.don.donID == i.donID
                           orderby i.don.date descending
                           select new { i.don.date, i.don.title, i.don.categoryID, i.imageUrl, i.don.cityID, i.donID };

                var res = dons.ToList();
                foreach (var dn in res)
                {
                    TableRow row = new TableRow();
                    TableCell cell = new TableCell();

                    cell.Text = dn.date;
                    row.Cells.Add(cell);

                    cell = new TableCell();
                    cell.Text = "<a href='DonDetails.aspx?donID=" + dn.donID + "'><img src = 'Images/" + dn.imageUrl + "' width='100px' heigth='100px' alt='" + dn.title + "' title='" + dn.title + "'/></a>";
                    row.Cells.Add(cell);

                    cell = new TableCell();
                    cell.Text = "<a href='DonDetails.aspx?donID=" + dn.donID + "'>" + dn.title + "</a>";
                    row.Cells.Add(cell);

                    cell = new TableCell();

                    var catName = from d in context.categories
                                  where d.categoryID == dn.categoryID
                                  select d.categoryName;

                    var cityName = from c in context.cities
                                   where c.cityID == dn.cityID
                                   select c.cityName;

                    cell.Text = catName.First() + "<br />" + cityName.First();

                    row.Cells.Add(cell);

                    tblData.Rows.Add(row);


                }

            }

Can I do the same with gridview? and how?
 

var dons = from i in context.images
                           where i.don.donID == i.donID
                           orderby i.don.date descending
                           select new { i.don.date, i.don.title, i.don.categoryID, i.imageUrl, i.don.cityID, i.donID };

Assigned above result set to data grid  as

gridView.DataSource = dons;
gridView.DataBind();

attached a event handler for row data bound event on grid by adding following attribute

OnRowDataBound="GridViewRowEventHandler"

 

Code behind for event handler

  void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
  {


    if(e.Row.RowType == DataControlRowType.DataRow)
    {
      // you can do the stuff what ever you are doing in foreach loop
      // to access the data bound to each to you can acces it  using e.Row.DataItem

      DataRowView rowView = (DataRowView)row.DataItem //use this row view variable to access the values for current row
      e.Row.Cells[1].Text = "<i>" + e.Row.Cells[1].Text + "</i>";

    }

for grid view layout like hyperlink, images and button you can use Grid View Template fields, refer following urls for template field demo and you can google out as well

http://msdn.microsoft.com/en-us/library/aa479353.aspx

http://stackoverflow.com/questions/11110022/asp-net-gridview-templatefield-with-multiple-items

http://stackoverflow.com/questions/4795903/how-to-access-templatefield-from-code-behind

[RESOLVED]javascript sort function is not updating the table

I have a GridView that I need to have the headers fixed and each column sortable. I am using ASP.NET and C#.

I found code to do this but I can’t get the columns to sort at all. I have stepped thru this code and it is calling the Sort functions in the aspx file. When I clicked the sort buttons on the column headings, the display in the grid does not change (ascending/descending)
sort order. I am thinking it has something to do with the binding of the gridview with my data.

The original code is here:

http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-and-Client-Side-Sorting-using-jQuery-in-ASP.Net.aspx

I am very new to javascript and I am trying to understand how the functions call the sort.  When the sort is triggered, it calss .trigger("sorton"… ).  Is this a javascript event?  I don’t see where it is described in tutorials. 

Thanks,

Below is the aspx file:

<head runat="server">
    <title>Create XML Files</title>
    <script src="/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="/scripts/jquery.tablesorter.min.js" type="text/javascript"></script>
    <script type = "text/javascript">
     $(document).ready(function() {
            $("#GridView1").tablesorter();
            SetDefaultSortOrder();
        });

        function Sort(cell, sortOrder) {
            var sorting = [[cell.cellIndex, sortOrder]];
            $("#<%=GridView1.ClientID%>").trigger("sorton", [sorting]);
            if (sortOrder == 0) {
                sortOrder = 1;
                cell.className = "sortDesc";
            }
            else {
                sortOrder = 0;
                cell.className = "sortAsc";
            }
            cell.setAttribute("onclick", "Sort(this, " + sortOrder + ")");
            cell.onclick = function() { Sort(this, sortOrder); };
            document.getElementById("container").scrollTop = 0;
        }


        function SetDefaultSortOrder() {
            var gvHeader = document.getElementById("dummyHeader");
            var headers = gvHeader.getElementsByTagName("TH");
            for (var i = 0; i < headers.length; i++) {
                headers[i].setAttribute("onclick", "Sort(this, 1)");
                headers[i].onclick = function() { Sort(this, 1); };
                headers[i].className = "sortDesc";
            }
        }

    function Check_Click(objRef)
    {
        //Get the Row based on checkbox
        var row = objRef.parentNode.parentNode;
        if(objRef.checked)
        {
            //If checked change color to Green
            row.style.backgroundColor = "lime";
        }
        else
        {
            //Change to original grey color
            row.style.backgroundColor = "#DEDFDE";
        }
    }
    </script>
    <style type = "text/css">
    .sortAsc
    {
        background-image: url(images/asc.gif);
        background-repeat: no-repeat;
        background-position: center right;
        cursor: pointer;
        width:200px;
    }
    .sortDesc
    {
        background-image: url(images/desc.gif);
        background-repeat: no-repeat;
        background-position: center right;
        cursor: pointer;
        width:200px;
    }
    .grid THEAD
    {
         background-color:Purple;
         color:White;
    }
        .style1
        {
            width: 113px;
        }
        .style2
        {
            width: 152px;
        }
    </style>
</head>

This is the gridview table:

 <div style =" background-color:Purple; height:30px;width:417px; margin:0;padding:0">
        <table cellspacing="0" cellpadding = "0" rules="all" border="1" id="dummyHeader" 
         style="font-family:Arial;font-size:10pt;width:417px;color:white;
         border-collapse:collapse;height:100%;">
         <tr>
               <th scope="col" style ="width:77px;text-align:center">Select for File</th> 
               <th scope="col" style ="width:48px;text-align:center">Number</th>
               <th scope="col" style ="width:50px;text-align:center">District</th>
         </tr>
        </table>
    </div>
    
    <div id = "container" style ="height:186px; width:435px; overflow:auto;">
    <asp:GridView ID="GridView1" runat="server" ShowHeader="False" AllowSorting="True" 
        AutoGenerateColumns="False" CssClass = "grid" CellPadding="3" ForeColor="White" 
        GridLines="None" Height="69px" Width="417px" BackColor="White" 
            BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellSpacing="1" 
            style="margin-bottom: 0px">
       
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:CheckBox ID="SelectedStation" runat="server" 
                        Checked='<%# Convert.ToBoolean(Eval("SelectedStation")) %>' 
                        onclick="Check_Click(this)"/>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="80px" />
            </asp:TemplateField>
            <asp:BoundField DataField="Number" HeaderText = "Number" >
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="District" HeaderText = "District" >
                <ItemStyle Width="50px" />
            </asp:BoundField>
        </Columns>
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
    </asp:GridView>
    </div>
    

This is how I bind the DataTable to the gridview.  I only do this at Page_load event

   stationTable = new DataTable();
   stationTable.Columns.Add(new DataColumn("SelectedStation", typeof(bool)));
   stationTable.Columns.Add(new DataColumn("Number", typeof(int)));
   stationTable.Columns.Add(new DataColumn("District", typeof(string)));

  var query = from stations in xml.Elements("Config").Elements("distributedHost").Elements("station") // Elements("Config").Elements("distributedHost").Elements("station").Elements("district")
                             select new 
                            {   
                                selectedStation = false,
                                number = stations.Element("number").Value,
                                district = stations.Element("district").Value
                            } ;

                foreach (var row in query)
                {
                    DataRow dataRow = stationTable.NewRow();

                    dataRow[stationTable.Columns["SelectedStation"]] = row.selectedStation;
                    dataRow[stationTable.Columns["Number"]] = row.number;
                    dataRow[stationTable.Columns["District"]] = row.district;
                 
                    stationTable.Rows.Add(dataRow);
                }
                GridView1.DataSource = stationTable;
                GridView1.DataBind();

My concern is that I am not calling the sorton event correctly or I am not rebinding the results of the sort to the gridview so it is not updating the display.

ANy help would be greatly appreciated.

Gloria

Hi,

I think the problem may be about date.

I have those link you can for more detial:

http://forums.asp.net/t/1661313.aspx/1

http://stackoverflow.com/questions/8720242/asp-net-gridview-and-xmldatasource-binding-at-run-time

http://tablesorter.com/docs/

hope this helps!

 

[RESOLVED]RSS News feed Query? text rendering

hi,.

I am using a news feed service but in the "description" the text renders like below with a [...] -

Nobody can agree on who invented the blues or birthed rock & roll but there is no question that
[...] –

Is there a way to remove [...] – because I put a hyperlink "read more that looks better"

thank you

<asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" Width="680px" RepeatDirection="Horizontal" CellPadding="7" CellSpacing="4">
<ItemTemplate>

<h2 style="color: #000000; font-style: normal; font-variant: normal; font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; padding-left: 0px; padding-top: 0px; margin-top: 0px;">

<a href="<%# XPath("link") %>" " style="color: #000000; text-decoration: none;"><%# XPath("title") %></a>

</h2>

<h4 style="font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; font-style: normal; font-variant: normal; text-transform: none; color: #666666">

<asp:Label ID="Label1" runat="server" Text=’
<%# XPath("description") %>’></asp:Label>

<asp:HyperLink ID="HyperLink1" runat="server"

NavigateUrl = ‘<%# XPath("link")%>’

ForeColor="#3366FF">more >></asp:HyperLink>

</h4>

</ItemTemplate>
</asp:DataList>

<asp:XmlDataSource ID="XmlDataSource1" Runat="server"
DataFile="http://www.rollingstone.com/siteServices/rss/musicNewsAndFeature"
XPath="rss/channel/item[position()<=3]" EnableCaching="false" />
</asp:XmlDataSource>

Hi,

For this situation, by design the RSS News feed RSS News feed XPath("description") displays with [...]. If you want to remove or change the [...] with some other characters, you could try to use below method:

replace the <%# XPath("description") %>’> codes with below method:

<asp:Label ID="Label1" runat="server" Text='
<%#CustomeDescription() %>'></asp:Label><br/>

add the method within .aspx.cs file:

public string CustomeDescription()
        {
            string description = XPath("description").ToString();

            string description2=description.Replace("[...]", "XXXXXX");
            return description2;
        }

Replace method:

http://www.dotnetperls.com/replace

Regards

great – thanks shawn. that worked!

[RESOLVED]Reference Local XSD

I’m displaying xml file data using an XmlDataSource and GridView.  I works great, but VS throws a ton of warnings because of a missing schema.  I generated a schema (using xsd.exe) and am trying to pair them up.  I’ve found some examples but they are for
web located schemas not local files.  I don’t really understand the URI namespace thing so I’m struggling.

XML

<?xml version="1.0" encoding="UTF-8"?>
<ListReport Name="Org"
 
xmlns="http://<somethinghere>"
xmlns:xsi="http://<somethinghere>"
xsi:schemaLocation="http://<somethinghere> ../Documentation/Org.xsd">
 
<OrganizationUnit Name="Organization" ParentOrganization="&lt;None&gt;" Comment="Organization... " />
<OrganizationUnit Name="Customer Support Agent" ParentOrganization="Customer Support" Comment="The..." />
<OrganizationUnit Name="Technology Services" ParentOrganization="Organization" Comment="Techno... " />
<OrganizationUnit Name="Customer Support Manager" ParentOrganization="Customer Support" Comment="The..." />
<OrganizationUnit Name="Service Delivery Team" ParentOrganization="Service Delivery" Comment="The..." />
<OrganizationUnit Name="Service Delivery Manager" ParentOrganization="Service Delivery" Comment="The..." />
<OrganizationUnit Name="Project Architect" ParentOrganization="Project Services" Comment="The..." />
<OrganizationUnit Name="Service Requestor" ParentOrganization="Organization" Comment="The..." />
<OrganizationUnit Name="Customer Support" ParentOrganization="Technology Services" Comment="Customer..." />
<OrganizationUnit Name="Service Delivery" ParentOrganization="Technology Services" Comment="Service..." />
<OrganizationUnit Name="Project Services" ParentOrganization="Organization" Comment="Project..." />
<OrganizationUnit Name="Request Analyst" ParentOrganization="Customer Support" Comment="..." />
</ListReport>

XSD

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="ListReport">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="OrganizationUnit" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="Name" type="xs:string" />
            <xs:attribute name="ParentOrganization" type="xs:string" />
            <xs:attribute name="Comment" type="xs:string" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="Name" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="ListReport" />
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

Hi,

Tessalator

generated a schema (using xsd.exe) and am trying to pair them up.  I’ve found some examples but they are for web located schemas not local files.  I don’t really understand the URI namespace thing so I’m struggling.

Better go through a swift tutorial on that. It’s not as complicated as it appears at first. Below is a good article:

Introduction to XML Schema

http://www.w3schools.com/Schema/schema_intro.asp

In your Case use the default URI’s.

For default values for XML Schema. Refer to the following article:

http://msdn.microsoft.com/en-us/library/ms256129(v=vs.110).aspx

Use:

xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns=http://tempuri.org/your.xsd

Hope it helps!

Best Regards!

Thanks Sam, I’m getting closer.  The part I’m having trouble with is the part of the URI after the : – like xs, xsi, <local>, etc., though it seems that much of that doesn’t appliy to what I am doing right now.

I am using

<ListReport Name="Org"
xmlns="http://www.w3.org/2001/XMLSchema"
schemaLocation=" ../Documentation/Org.xsd">

and is has cleared all of the warnings except one: " The
http://www.w3.org/2001/XMLSchema:ListReport
element is not declared"

The code you suggested clears the "ListReport" warning, but not the warnings on the other elements.

I have tried things like xmlns:ListReport, and = "http://www.w3.org/2001/XMLSchema:ListReport" or both together but no luck.

They clear that error, but then I get errors about the other elements.

I was also getting a message about "UseCurrentLocale" in the xsd, but deleted the whole "NewDataSet" element without ill effects and that went away.

Hi,

Tessalator

and is has cleared all of the warnings except one: " The
http://www.w3.org/2001/XMLSchema:ListReport
element is not declared"

The code you suggested clears the "ListReport" warning, but not the warnings on the other elements.

I have tried things like xmlns:ListReport, and = "http://www.w3.org/2001/XMLSchema:ListReport" or both together but no luck.

They clear that error, but then I get errors about the other elements.

I was also getting a message about "UseCurrentLocale" in the xsd, but deleted the whole "NewDataSet" element without ill effects and that went away.

It doesn’t seem to me we are going in the right direction. Generally it is important to create Schema files when the XML files is to be stored specific Data. But since it is not done your case and it is to be used in VS. There is another easy way to accomplish
it.

Follow the Steps:

Change your XML to as it was initially:

<?xml version="1.0" encoding="utf-8" ?>
<ListReport Name="Org">
<OrganizationUnit Name="Organization" ParentOrganization="&lt;None&gt;" Comment="Organization... " />
<OrganizationUnit Name="Customer Support Agent" ParentOrganization="Customer Support" Comment="The..." />
<OrganizationUnit Name="Technology Services" ParentOrganization="Organization" Comment="Techno... " />
<OrganizationUnit Name="Customer Support Manager" ParentOrganization="Customer Support" Comment="The..." />
<OrganizationUnit Name="Service Delivery Team" ParentOrganization="Service Delivery" Comment="The..." />
<OrganizationUnit Name="Service Delivery Manager" ParentOrganization="Service Delivery" Comment="The..." />
<OrganizationUnit Name="Project Architect" ParentOrganization="Project Services" Comment="The..." />
<OrganizationUnit Name="Service Requestor" ParentOrganization="Organization" Comment="The..." />
<OrganizationUnit Name="Customer Support" ParentOrganization="Technology Services" Comment="Customer..." />
<OrganizationUnit Name="Service Delivery" ParentOrganization="Technology Services" Comment="Service..." />
<OrganizationUnit Name="Project Services" ParentOrganization="Organization" Comment="Project..." />
<OrganizationUnit Name="Request Analyst" ParentOrganization="Customer Support" Comment="..." />
</ListReport>

Now, In the VS Menubar you will see an option XML.

Click the XML option > Create Schema

It will autogenerate the required Schema.

The one at my end looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ListReport">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="OrganizationUnit">
          <xs:complexType>
            <xs:attribute name="Name" type="xs:string" use="required" />
            <xs:attribute name="ParentOrganization" type="xs:string" use="required" />
            <xs:attribute name="Comment" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="Name" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>

Right click the XML file in the Designer > go to Properties and check if the Schema file is associated.

Now, Build the solution. Hopefully you will find no warning or error. This is the prefered way. The Schema files are complicated sometimes and need proper URI. Default URI’s can be used if there are No registerd URI.

Hope it helps!

Best Regards!

That did it, thanks.  For others that find this, I had to go through twice for some reason.  When I looked in schemas the first time it had several checked – every one of the SharePoint schemas was checked and I was still getting the warnings.  Walked through
it again and the correct ones were checked (except the newly generated).  Checked that, did the build, and it worked perfectly.

[RESOLVED]How to design a beautiful navigate menu? where can find that template?

in vwd2008, how shall we get this goal with a wonderful template?

where can we find such template?

especiallly how to design that menu like that of frontpage or dreamweave, which can build up and link automatically?

Hello, 

I am not too good with design myself, but I found this http://twitter.github.io/bootstrap/ invaluable.

it really cuts the time of making web pages look good! 

thank you.

That looks like nice, seem as dreamweave templates. I shall study and reply soon.

 

thank you,

but they seem build by css, not by this c#

can you have any one that by this vwd express?

zhgart

can you have any one that by this vwd express?

once I did like below. hope you could bind it up.

<asp:Menu ID="Menu1" DataSourceID="xmlDataSource" runat="server" DynamicVerticalOffset="2" Height="25" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false" StaticItemFormatString="&nbsp; {0} &nbsp;" EnableTheming="False" Width="778px" DynamicEnableDefaultPopOutImage="False" AccessKey="M" OnMenuItemDataBound="Menu1_MenuItemDataBound">
               <StaticMenuStyle BackColor="#2E789A" BorderStyle="None" ForeColor="White" HorizontalPadding="1px" />
                  <StaticMenuItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
                      Font-Names="Tahoma" Font-Size="11px" ForeColor="White" HorizontalPadding="1px" BackColor="SteelBlue" Font-Bold="True" Height="20px" />
                  <DynamicMenuStyle BackColor="#2E789A" BorderColor="Black" BorderStyle="Outset" BorderWidth="1px" VerticalPadding="3px" />
                  <DynamicMenuItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" HorizontalPadding="5px"
                      Font-Names="Tahoma" Font-Size="11px" VerticalPadding="3px" Width="150px" BackColor="SteelBlue" Font-Bold="True" />
                  <StaticHoverStyle BackColor="#5B94AF" BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                  <DynamicHoverStyle BackColor="#5B94AF" BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
             <DataBindings>
               <asp:MenuItemBinding DataMember="MenuItem"
             NavigateUrlField="NavigateUrl" TextField="Text1" ToolTipField="ToolTip"/>
             </DataBindings>
          </asp:Menu>
<asp:XmlDataSource ID="xmlDataSource" TransformFile="~/TransformXSLT.xsl"
          XPath="MenuItems/MenuItem" EnableCaching="False" runat="server"/>




//// TransformXSLT.xsl file
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes" encoding="utf-8"/>
  <!-- Find the root node called Menus
       and call MenuListing for its children -->
  <xsl:template match="/Menus">
    <MenuItems>
      <xsl:call-template name="MenuListing" />
    </MenuItems>
  </xsl:template>
 
  <!-- Allow for recusive child node processing -->
  <xsl:template name="MenuListing">
    <xsl:apply-templates select="Menu" />
  </xsl:template>
 
  <xsl:template match="Menu">
    <MenuItem>
      <!-- Convert Menu child elements to MenuItem attributes -->
      <xsl:attribute name="Text1">
        <xsl:value-of select="Text1"/>
      </xsl:attribute>
      <xsl:attribute name="ToolTip">
        <xsl:value-of select="Description"/>
      </xsl:attribute>
      <xsl:attribute name="NavigateUrl">
        <xsl:text></xsl:text>
        <xsl:value-of select="Url"/>
      </xsl:attribute>
      
      <!-- Call MenuListing if there are child Menu nodes -->
      <xsl:if test="count(Menu) > 0">
        <xsl:call-template name="MenuListing" />
      </xsl:if>
    </MenuItem>
  </xsl:template>
</xsl:stylesheet>




/// cs file
protected void Bind_Menu()
    {
        DataSet ds = new DataSet();
        string sql = "Select MenuID, Text1, Description, ParentID,Url from mtblLink where " + Session["UserType"] + "=1 order by MenuId";
        ds = myCls.My_Dataset(sql);
        ds.DataSetName = "Menus";
        ds.Tables[0].TableName = "Menu";
        DataRelation relation = new DataRelation("ParentChild", ds.Tables["Menu"].Columns["MenuID"], ds.Tables["Menu"].Columns["ParentID"], true);
        relation.Nested = true;
        ds.Relations.Add(relation);
        xmlDataSource.Data = ds.GetXml();
    }

    protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
    {
        if (e.Item.NavigateUrl == "")
            e.Item.Selectable = false;
    }

// my sql table
CREATE TABLE [dbo].[mtblLink](
	[MenuId] [bigint] NOT NULL,
	[Text1] [varchar](250) NOT NULL,
	[Description] [varchar](250) NULL,
	[ParentID] [bigint] NULL,
	[URL] [varchar](250) NULL,
	[Administrator] [bit] NOT NULL,
	[StaffUser] [bit] NULL,
	[OtherUser] [bit] NULL
) ON [PRIMARY]

here I bind it dynamically.

try to build it up.

Thanks

thanks.

and do you have any material that build a menu automatically like frontpage does?

Well, Having a navigate menu is essential thing for every website or user friendly website. There are lots of navigate menu’s templates are available on the internet. So we could easily find the best one template to designing a webpage.

yes we have many such templates we can find. but they will not as like action as frontpage does in a web page design. so automatic that we do not take acount of the superlink issue.

[RESOLVED]Is it possible to set a schedule rotation in a calendar control?

BY this i mean, we have a schedule rotation that is shared amoung 5 users.. but the rotation is based per week.

So it would be something like this:

Week1 = Day1 = user1, user2, user3, user4, user5

Week1 = Day2 = user2, user3, user4, user5, user1

Week1 = Day3 = user3, user4, user5, user1, user2

And so on.. would this be easier to base per week or per work day? Basically the rotation starts over every 5th week

Just trying to see if its something i can handle based on a database table or just hard code an array to handle and if so, how to deal with it repeating/starting over every 5th week.

Any suggestions, examples or links would be great.

Ive found and implemented some simple event displaying on the days, which i can use to display the rotation on the calendar, just not sure how to handle the rotation part.

thank you

My idea is using modulus like this : VB: (value + n mod 5) or c#/SQL : (value + n % 5)

1

1 + 1 mod 5 = 2

2 + 1 mod 5 = 3

3 + 1 mod 5 = 4

4 + 1 mod 5 = 0

5 + 1 mod 5 = 1

2

1 + 2 mod 5 = 3

2 + 2 mod 5 = 4

3 + 2 mod 5 = 0

4 + 2 mod 5 = 1

5 + 2 mod 5 = 2

3

1 + 3 mod 5 = 4

2 + 3 mod 5 = 0

3 + 3 mod 5 = 1

4 + 3 mod 5 = 2

5 + 3 mod 5 = 3

4

1 + 4 mod 5 = 0

2 + 4 mod 5 = 1

3 + 4 mod 5 = 2

4 + 4 mod 5 = 3

5 + 4 mod 5 = 4

5

1 + 1 mod 5 = 2

2 + 1 mod 5 = 3

3 + 1 mod 5 = 4

4 + 1 mod 5 = 0

5 + 1 mod 5 = 1

6 (back to first)

1 + 6 mod 5 = 2

2 + 6 mod 5 = 3

3 + 6 mod 5 = 4

4 + 6 mod 5 = 0

5 + 6 mod 5 = 1

See the results is rotated

value is user number

n is day value in integer

So using your example in c#, would i just hardcode it?

Create 5 sets like you illustrated and then find a way to bind to the calendar?

i would sugegst you try using some Calendar / Schedule control and check out the link for details:

Free Calendar / Schedule control

http://forums.asp.net/t/1532676.aspx

Databound Schedule
Control
s

http://www.codeproject.com/Articles/7619/Databound-Schedule-Controls

Hope it helps you.

I appreciate the links, but most if not all offer way more than what we need and some look very involved to setup for something simple we need.

The calendar we are tryign to setup is going to serve one purpose and that is to show the schedule rotation.

They are going to open the page and instantly see a full page calendar that displays the rotation within each day.

No clicking or selecting will be allowed..

I was able to bind the rotation to the calendar control in VS, but was more in need of assistance in trying to make the rotation dynamic some way so that the admin can change it or set it and forget it..

 if you retrieve the data from database, then according to your logic
grouping them.  Only adding to the
respective
corresponding period
of days or Times.

i think that you can try using DataCalendar class.The DataCalendar class is described with specific attention to data binding, templates, and styles.

please check out the demo and have a try:

DataCalendar

http://www.codeproject.com/Articles/5347/DataCalendar

you also can try using daypilot and check out the demo below:

http://www.daypilot.org/demo/Calendar/BindingXmlDataSource.aspx

if it is not helpful for you, Couldd provide any additional code or markup related to this issue?

You’d better a simple demo which is based on your current codes, in order to help us to understand your issue better.

Thank you for your understanding.