Using gridivew as asyncpostbacktrigger

When I click “delete” linkbutton inside gridview I want the bulletedlist item will added programmatically. So on linkbutton “lnkDelete” I added new method called load.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="row" id="tbMessage" runat="server" visible="false">
<asp:BulletedList runat="server" ID="blErrorMessage" BulletStyle="Square" DisplayMode="Text">
</asp:BulletedList>
</div>
</ContentTemplate>
</asp:UpdatePanel>

<asp:UpdatePanel ID="upEmployeeList" runat="server">
<ContentTemplate>
<asp:GridView runat="server" id="gvwEmployeeList" AutoGenerateColumns="false" Width="100%" OnRowCommand="gvwEmployeeList_RowCommand" >
<Columns>
<asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Center">
<ItemStyle Width="125px" />
<ItemTemplate>
<asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%#Eval("UserName")  %>' CommandName='Hapus' Text='Delete' OnLoad="lnkDelete_Load"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name" ItemStyle-HorizontalAlign="Left" Visible="true"
ItemStyle-VerticalAlign="Top">
<ItemStyle Width="150px" />
<ItemTemplate>
<asp:Label ID="lblFullName" runat="server" Text='<%#Eval("PreferredName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="User Name" ItemStyle-HorizontalAlign="Left" Visible="true"
ItemStyle-VerticalAlign="Top">
<ItemStyle Width="150px" />
<ItemTemplate>
<asp:Label ID="lblUserName" runat="server" Text='<%#Eval("UserName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

This is the code behind.

        protected void lnkDelete_Load(object sender, EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;
            UpdatePanel1.Triggers.Add(new AsyncPostBackTrigger { ControlID = btn.UniqueID, EventName = "click" });
        }

        protected void gvwEmployeeList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Hapus":
                        string errMessage = string.Empty;
                        try
                        {
                           .....
                           .....
                        }
                        catch(Exception ex)
                        {
                           errMessage = ex.ToString();
                        }

                        if (!string.IsNullOrEmpty(errMessage))
                        {
                           blErrorMessage.Items.Clear();
                           blErrorMessage.Items.Add(errMessage);
                        }                       
                        break;
              }
        }

By using above code I can show the item added to “blErrorMessage” inside UpdatePanel1

Reference : http://www.npathweb.com/2009/09/21/using-gridview-controls-as-a-asyncpostbacktrigger/

Redirect based on query string

var isFirstTime = “0”;
var queryString = “IsFirstTime”;
var url = window.location.href;
if (url.indexOf(‘?’ + queryString + ‘=’) != -1)
{
isFirstTime = “1”;
}
else if (url.indexOf(‘&’ + queryString + ‘=’) != -1) {
isFirstTime = “1”;
}
else
{
isFirstTime = “0”;
}

if (isFirstTime == 1) {
window.location = “../page/frmFirstPage.aspx”;
}
else
{
window.location = “../page/frmSecondPage.aspx”;
}
return false;

My Server Specification for SAP Mini

Notebook type: ASUS A42F

Running on : VMWare 3.0.0

SAP NetWeaver AS ABAP 7.02 SP6 32-bit Trial (http://www.sdn.sap.com/irj/sdn/index?rid=/library/uuid/80db43c2-9ee5-2d10-de8e-8547de363868)

SAP NetWeaver 7.02 ABAP Developer Edition System Requirements:

JRE 1.5.0.2

Operating System:

Windows Server 2003 Enterprise Edition Service Pack 2

Hostname must not exceed 13 characters

NTFS-File systems

Internet Explorer 6.0

2816 MB RAM

Intel (R) Core (TM) i3 CPU

55 GB hard disk space

 

MSDTC detected that the MSDTC on DEVSW49 has the same unique identity as the local MSDTC

MSDTC detected that the MSDTC on DEVSW49 has the same unique identity as the local MS DTC

 

How to solve this problem?

This case often occurs when the Web Server for ASP.NET separated with database server.

Follow the following instruction:

  1. Unistall MSDTC with this following command :  ‘msdtc -uninstall’
  2. Restart your database server to refresh your registry
  3. Install MSDTC with this following command :  ‘msdtc -install’
  4. At the end your MSDTC will successfully installed

 

How if there is error message appear like ‘Transaction error message’ on web server?

Just restart your Application server to refresh your server and then your application will running

Solusi untuk error di Reporting Services Server

Jika ketika mengakses http://localhost/reportserver muncul error seperti pesan berikut ini.

Reporting Services Error


  • The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable) Get Online Help
    • For more information about this error navigate to the report server on the local server machine, or enable remote errors

    SQL Server Reporting Services

 

Berikut ini adalah solusinya:

Pada command prompt ketikkan command dengan format seperti berikut.

rsconfig -c -s <SQLSERVERNAME> -d reportserver -a Windows -u <MYDOMAIN\MYACCOUNT> -p <PASSWORD>

Contoh.
rsconfig -c -s prod01 -d reportserver -a Windows -u mikrosaft\ultima -p password