Header

Tuesday, 13 December 2011

SharePoint page mode(Edit/Not Edit)


We can check page mode by this value.
If it is one then page is in edit mode.
 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
document.forms[0].elements["MSOLayout_InDesignMode"].value
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Thanks and Regards

Saturday, 3 December 2011

Insert data using SPAPI

We need to call this function for adding content in lis..
function Feedbackadd()
   {
            var regad_var = $("#regad1 option:selected").text();
            \\ Get the value from one DropDown list that id is regad1
            var sub_var = $("#sub1").attr('value'); 
           \\ Get the value from one text box that id is sub1.
            var name_var = $("#name1").attr('value');
            \\ Get the value from one text box that id is name1.
            var email_var = $("#email1").attr('value');
            \\ Get the value from one text box that id is email1.
            var msg_var = $('#textareamsg1').val();
             \\ Get the value from one text box that id is textareamsg1.
            var lists = new SPAPI_Lists('listLocationt');
            \\ Give the location of document where Feedback list is there.
            var res = lists.quickAddListItem('Feedback', { Title:sub_var, Regarding:regad_var, Subject:sub_var, Name:name_var, Email:email_var, Message:msg_var });
      
         if (res.status == 200)
            {
                alert('Thank you for Feedback.');
              }
            else
            {
                alert('Unexpected error.');
            }
          
        }


Thanks ....................:-) 

How to Register User Control

There are 2 way to register a user control in asp page.
  1. Register in asp page on top
  2. Add in web.config file
To register a user control in aspx page we need to add
<%@ Register TagPrefix="adms" TagName="Student" src="~/StudentDetails" %>

We can register our user control in web.config file. By this way we can use our user control anywhere in our solution, no need to register on every page manually. For doning this we need to modify our web.config file

<?xml version="1.0"?>
  <configuration>
    <system.web>
   <pages>
     <controls>
    <add tagPrefix="adms" src="~/Controls/StudentDetails" tagName="Student"/>
    <add tagPrefix="ControlVendor" assembly="ControlVendorAssembly"/>
     </controls>
   </pages>
    </system.web>
  </configuration>

***********************
But when we register our user control in web.config file we need to check location of user control bcz we cant keep both (web.config, user control) at same locaion
  ******************

If want to use this user control we can use like below
<adms:Student id="show" runat="server" />


Thanks

Friday, 2 December 2011

Position Change on Hover

For doing this we need two image. 
Fist one will be visible bydefault and scecond will appear on hover.
Now we need to add both image in single image, on top part add default image and in bottom part add hover image.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#onHover_adms a{
background:url("previous.png") 0 0 no-repeat;
font-size:25px;
padding-right:18px;
}
#onHover_adms a:hover{
background-position:0px -29px;
}

<div id="onHover">
<a href="#">&nbsp;</a>
</div>

Thanks........................