Moving to the New Blogger Interface. We introduced a new user interface that makes it easier for view code, find article and sharing.
Kindly to access to http://www.sharedude.net for serve you better. Thanks for all your support.
Moving to the New Blogger Interface. We introduced a new user interface that makes it easier for view code, find article and sharing.
Kindly to access to http://www.sharedude.net for serve you better. Thanks for all your support.
Recently a friend of mine are asking about ASP.net Web form vs MVC which one are better and which one should go for starting an application? I was given some opinion and discussion with him regarding the pros and cons about web form and MVC. Therefore, I decided to written it down in my blog for as references whether web form or MVC.
ASP.NET MVC
| Pros |
|
| Cons |
|
| Threats |
|
| Opportunities |
|
ASP.NET WebForms
| Pros |
|
| Cons |
|
| Threats |
|
| Opportunities |
|
When to use ASP.net WebForm or MVC?
C#:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[0].CssClass = “locked”;
e.Row.Cells[1].CssClass = “locked”;
}
html:
<head runat=”server”>
<title>Untitled Page</title>
<style type=”text/css”>
div#div-datagrid {
width: 220px;
height: 100px;
overflow: auto;
scrollbar-base-color:#ffeaff;
}
/* Locks the left column */
td.locked, th.locked {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
left: expression(document.getElementById(“div-datagrid”).scrollLeft-2);
}
/* Locks table header */
th {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
top: expression(document.getElementById(“div-datagrid”).scrollTop-2);
z-index: 10;
}
/* Keeps the header as the top most item. Important for top left item*/
th.locked {z-index: 99;}
/* DataGrid Item and AlternatingItem Style*/
.GridRow {font-size: 10pt; color: black; font-family: Arial;
background-color:#ffffff; height:35px;}
.GridAltRow {font-size: 10pt; color: black; font-family: Arial;
background-color:#eeeeee; height:35px;}
</style>
</head>
<div id=”div-datagrid”>
<asp:GridView DataSourceID=”SqlDataSource1″ ID=”GridView1″ runat=”server” OnRowCreated=”GridView1_RowCreated” OnRowDataBound=”GridView1_RowDataBound”>
</asp:GridView> </div>
If you are looking for a script that able to retrieve from select statement, below script will help you to retrieve.
SELECT physical_name,
CASE
WHEN is_percent_growth = 0
THEN LTRIM(STR(growth * 8.0 / 1024,10,1)) + ‘ MB, ‘
ELSE
‘By ‘ + CAST(growth AS VARCHAR) + ‘ percent, ‘
END +
CASE
WHEN max_size = -1 THEN ‘unrestricted growth’
ELSE ‘restricted growth to ‘ +
LTRIM(STR(max_size * 8.0 / 1024,10,1)) + ‘ MB’
END AS Autogrow
FROM sys.database_files
What you need to do is follow the steps below to try again the debugging mode
If you look for hide the left navigation from SharePoint 2010, definitely you can use the below stylesheet to override the global css.
Add this code in the content editor and apply the changes:
<Style>
#s4-leftpanel
{
display: none;
}
.s4-ca
{
margin-left: 0px;
}
</style>
You able to apply this method to override other class id that you would like to change.
SharePoint 2010 have introduces the new dialog framework for assist users to stay in the context of the page without navigate away from other page.
The JavaScript object model provides the SP.UI.ModalDialog class to work with the dialog framework. In order to work with dialog framework, first create the dialog options as below:
var options = SP.UI.$create_DialogOptions();
options.width = 500;
options.height = 250;
options.url = "/_layouts/StandardsPortal/ChangePassword.aspx";
options.dialogReturnValueCallback = Function.createDelegate(
null, portal_modalDialogClosedCallback);
As you can see above code, set options on width, height and the URL of the modal dialog load. If you notice, that is also initialize the call back.
You can write code below to show modal dialog:-
SP.UI.ModalDialog.showModalDialog(options);
Try to write this code into function:
function portal_openModalDialog() {
var options = SP.UI.$create_DialogOptions();
options.width = 500;
options.height = 250;
options.url = "/_layouts/StandardsPortal/ChangePassword.aspx";
options.dialogReturnValueCallback = Function.createDelegate(
null, portal_modalDialogClosedCallback);
SP.UI.ModalDialog.showModalDialog(options);
}
You can now call this JavaScript function from your custom action or from web part or from your custom page or from your custom Ribbon button. Below is the custom action XML:
<CustomAction
Id="{F93B1F84-1DBE-4C10-82E3-2CA47346359E}"
Title="Change Password"
Description="Change your password"
Sequence="1000"
Location="Microsoft.SharePoint.StandardMenu"
GroupId="PersonalActions"
ImageUrl="~sitecollection/_layouts/images/menulistsettings.gif">
<UrlAction Url="javascript:portal_openModalDialog();"/>
</CustomAction>
Notice how we invoke the JavaScript dialog:
<UrlAction Url="javascript:portal_openModalDialog();"/>
Below is the dialog callback code (very simple actually):
function portal_modalDialogClosedCallback(result, value) {
if (value == '1') {
this.statusId = SP.UI
.Status
.addStatus("Password Changed",
"Your password has been changed. Use it next time when you log in.",
true);
SP.UI.Status.setStatusPriColor(this.statusId, "Green");
}
if (value == '0') {
this.statusId = SP.UI
.Status
.addStatus("Password Change Failed",
"Your password has <b>not</b> changed. Please try again.",
true);
SP.UI.Status.setStatusPriColor(this.statusId, "Green");
}
setTimeout(RemoveStatus, 6000);
}
function RemoveStatus() {
SP.UI.Status.removeStatus(this.statusId);
}
As you can see, I pass a single value back and now I can check and show status based on that value. You can also check for the dialog result using SP.UI.DialogResult.OK and SP.UI.DialogResult.cancel properties:
function CloseCallback(result, value) {
if(result === SP.UI.DialogResult.OK) {
alert("OK was clicked!");
}
if(result === SP.UI.DialogResult.cancel) {
alert("Cancel was clicked!");
}
}
Showing a status is very simple using the SP.UI.Status.addStatus method.
Now, after deploying when you click on the Change Password custom action
You get the modal popup dialog opening the Application page URL set in the dialog options:
To wire the Modal Dialog ‘OK’ and ‘Cancel’ code, we write the appropriate code in the ‘Change Password’ button click & ‘Cancel’ button click:
this.Page.Response.Clear();
this.Page.Response.Write("
<script type=\"text/javascript\">window.frameElement.commonModalDialogClose(1, 1);</script>");
this.Page.Response.End();
If successful, you will see the following status:
If failed, you will see the following status:
private void Page_Load(object sender, System.EventArgs e) { WebClient wc = new WebClient(); byte[] data = wc.DownloadData("http://www.google.cn/intl/en-us/images/logo_cn.gif"); MemoryStream ms = new MemoryStream(data); System.Drawing.Image img = System.Drawing.Image.FromStream(ms); float iScale = img.Height > img.Width ? (float)img.Height / 100 : (float)img.Width / 100; img = img.GetThumbnailImage((int)(img.Width / iScale), (int)(img.Height / iScale), null, IntPtr.Zero); MemoryStream memStream = new MemoryStream(); img.Save(Server.MapPath("att.jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg); memStream.Flush(); }
1. Access SharePoint Central Administration
2. Click on Application Management and then click on manage web applications.
3. Click on new button to create a new web site.
4. Leave everything as default except under Application Pool, change Select a security account for this application pool to Predefined as Network Service and then click Ok button.
Remarks: It will take for a while depend on the server performance to create a web site.
5. Completed create web site.
1. Access to Application Management
2. Click on Create site collections under Site Collections.
3. Verify web application. If incorrect, change path
4. Enter title and description
5. Set as Default
6. It is depend on the requirements. As a start, you able to select under Collaboration and select for blank site
7. Predefine primary administrator and secondary administrator for.
Best Practice: Always assign to two different accounts for avoid any permission issue.
8. Quota Template is to use for control the storage size on the particulate site. For now, set as default.
9. Click ok and completed the site.
10. Verify the site by paste the url at IE browser.
1. Open your InfoPath form which already created by InfoPath Designer.
2. Click on the File tab on top of the InfoPath designer.
3. Select Publish Tab and Click on SharePoint Server button
4. Publish wizard prompt and enter URL which created in step 2 and then click next button.
5. Enter your password to publish into the collections sites.
6. Select form library and then click next.
7. Select “Create a new form library” – If collection sites already created a form library and required to use that, kindly to select “Update the form template in an existing form library”.
8. Enter Name and Description for a new form library.
9. Display column in your form library. You can modify it for add new column, remove or modify it. Those columns are the field in InfoPath.
10. Click on publish to publish the InfoPath Template.
11. Click Close
12. Verify the InfoPath whether publish into Form Library.
1. Click on Purchase Order Form
2. Click on Library button at the Ribbon Menu
3. Click on workflow setting under the Ribbon Menu
4. Select “Add a Workflow”.
5. Select a workflow template: “Approval – SharePoint 2010” (This is basic standard worklow)
Remarks: If looking for customization workflow, you need to use WF/SharePoint designer to create a new template and upload into SharePoint.
· Enter unique name for this workflow. This is for reusable if new document library required same workflow process.
6. Unchecked “Allow this workflow to be manu……” this one required user to manually submit the workflow to approver.
Checked “Start the workflow when a new item is created”.
Click next button to complete the workflow.
7. Predefine approver/groups/subject of email/due date/duration of tasks/ cc and etc.
1. Go to Purchase order form
2. Click on add document and filled in the form.
Remarks: SharePoint Foundation Server integration with InfoPath – User have to install InfoPath to access this. If user want to access without InfoPath, upgrade is required for Enterprise Version. Enterprise version features for InfoPath Services which able for user to access via Browser.
3. Submit the form and message prompt. If required password, use NT account ID and password.
4. You able to see the form is uploaded and status for Approval is in progress.
1. Approval Login to the Purchase Order Page
2. Approval able to review document by click on the Name.
3. InfoPath form will appear a message to approval for request approval.
4. Open this task to process for the approval process.
5. One approve, status will change to approved.
6. If reject, status will change it to rejected and required user to resubmit again.
7. Email notification will submit when the workflow process is trigger.
8. You can able to check the history transaction by
Click on the approval link
Workflow history will listed all the transaction including notification.
The idea of the architecture for TFS is everyone has their own workspace.
So, developers have to map their workspace from TFS and connect it to Navigator.
You will find an error as below:-
This means that, you don’t install the component below. Follow the step and setup for connect to TFS.
Look for in internet for this component: Foundation Server MSSCCI Provider.msi
Install Visual Studio Team Foundation Server MSSCCI Provider.msi at your local
After finish install, follow the below step for connect to your TFS server.
1. Login to your database
2. Check version control browser from team coding
3. Check whether connect to correct TFS server
4. If not, add TFS server and select the correct TFS server.
5. Connect to the correct Schemes
6. Create a local path for your workspace from browse. After created, click Ok.
7. Connect to DB
8. Go to menu, Team Coding |Connection Settings
9. Go to menu Team Coding |Code Control Groups, click Add Group button (see below) to create a group named tfs2008
10. Set the group to work with the schema
11. We could use SQL Navigator for Oracle to check-in/check-out, and getting latest source without the reported issues.