Dynamically Change URL OF Web Service



During Web Application Development and Implementation There are Required to Dynamic Change Url Of Web Service.It's Can Be Done by Following Way.


Add Key In Web.Config With Web Service Path name So it's can be Later Change after Published.


  < add key="save_photo" value="http://comp-7/TestMobile/Service.asmx" > 


Now in Class Where you Are Using this Web Service Do Following


localhost.Service service_all = new localhost.Service();
service_all.Timeout = 10000;
service_all.Url = ConfigurationManager.AppSettings["save_photo"]; 



Enjoy !!!!!!!




Prev Post                                                      All Post                                                           Next Post





Posted in | 5 comments

System.Data.OleDb.OleDbDataAdapter internal error: invalid parameter accessor: 1 BADBINDINFO.

Problem :-  base    {"System.Data.OleDb.OleDbDataAdapter internal error: invalid parameter accessor: 1 BADBINDINFO."}    System.SystemException {System.InvalidOperationException}

Description And Solution :-

While Using Store Procedure in Access (With .Net) if you Are try to Used Output Parameter
                 like

       
       OleDbCommand sqlCmd = new OleDbCommand();
       AddParamToSQLCmd(sqlCmd, "@ReturnValue", OleDbType.Integer, 0,        
       ParameterDirection.ReturnValue, null);
       SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_USER_MigrantEmployeeID);
   

               Then System Throw Exception like  "+        base    {"System.Data.OleDb.OleDbDataAdapter internal error: invalid parameter accessor: 1 BADBINDINFO."}    System.SystemException {System.InvalidOperationException}" 

                 While Googling and My Personal R & D i Come on Point that You can not Used Output Paramter in MS Acess  While it's Not a Problem With SQL Server.
             

.
Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

DateTime Format in SQL Server And MS Access

SQL SERVER 2000 
 
Convert DateTime Format in Sql Server Query.

   convert(varchar,emp.val_date,106) AS ind_date1    

106 is Format type Format Type List Give Below.



 
Style ID  Style Type    
0 or 100  mon dd yyyy hh:miAM (or PM)    
101  mm/dd/yy    
102  yy.mm.dd    
103  dd/mm/yy    
104  dd.mm.yy    
105  dd-mm-yy    
106  dd mon yy    
107  Mon dd, yy    
108  hh:mm:ss    
9 or 109  mon dd yyyy hh:mi:ss:mmmAM (or PM)    
110  mm-dd-yy    
111  yy/mm/dd    
112  yymmdd    
13 or 113  dd mon yyyy hh:mm:ss:mmm(24h)    
114  hh:mi:ss:mmm(24h)    
20 or 120  yyyy-mm-dd hh:mi:ss(24h)    
21 or 121  yyyy-mm-dd hh:mi:ss.mmm(24h)    
126  yyyy-mm-dd Thh:mm:ss.mmm(no spaces)    
130  dd mon yyyy hh:mi:ss:mmmAM    
131  dd/mm/yy hh:mi:ss:mmmAM  


MS Access :-

Format(a.sent_date,'dd-MMM-yyyy') as Email_Date
 
 
 
Prev Post                                                      All Post                                                           Next Post

Posted in | 1 comments

Encrypting and decrypting configuration sections in web.config

In Webapplication Configuration Section of Your Web Application Are Very Importent
Becuase it contain's your importent data like Connection Strings,Email id and Password
ect.. So We Need to Encrypt The Web.Config Perticular Section which contains
This Sensitive Information.it's can be done by following methods.

Encryption

Open your Visual 2005 Command Prompot and type Following Commands.

aspnet_regiis.exe -pe "appSettings
" -app  "/YourApplication Name"


So After Apply Encryption your App Setting Looks Like :-

< appSettings configProtectionProvider="RsaProtectedConfigurationProvider" >
     < EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
         xmlns="http://www.w3.org/2001/04/xmlenc#" >
         < EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" / >
         < KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#" >
             < EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#" >
                 < EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" / >
                 < KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#" >
                     < KeyName > Rsa Key < /KeyName >
                 < /KeyInfo >
                 < CipherData >
                     < CipherValue > H9WkRu3BZi7mrEv1Rz50SuN1uHi64mBKAlZKaU2FpwOjMc8Sp1eFqGmi5N
UssOxJgJUwIzp4OXdKaypAuvLG2lCwjosIS+cZXqwTmFQ6wn8Zqs8HSRMCh38Hrg
h+/fp5M4GNijinuDhzdPXMDZrAokU17lLXttq7N+Cl37v+tVI= 
< /CipherValue >
                 < /CipherData >
             < /EncryptedKey >
         < /KeyInfo >
         < CipherData >
             < CipherValue > WurKXXIZzc4lpEfzTmTUAqw638D08i1PZKQzinRUsW52TdI4rEJrAZm6xVRtfVry
M3E81Pri9ZmxR/lXofJFRFDWG7KH4hIXkYZ12yTQ5YaQzuz6C/dtZ5IpSyNfTMzHE+hV0cZJVhe
2X5v5pXM1op5V4pjxGNJ5WpVXoXrvRFkIWDKNGjU9WY3BtL1HTUyzfZL61jrmg23hqPodH
B4z6oh1aUy27Sa46IZh+r+rbqlRgCusol+V06N7WcCRJhgfgfMNRKsGX12nDWJRZnWnF9kg
7ko2CK75xIa+keqaTwdoIyRf02+/Dhee3Sc2n+uBXWyHbPI8pK7CA69btzEIvxoudj7PIIse
LgE8Un8+HMQvpXylosO3A2FgzwjgUKN7dGVV9NElCAS+xfAO0YdXY/mRaWi3eB8DTnKGtVNId7
hTBJddT01GCg8eBgX5NXqg173yXg3N5+P1a3+X00Szxo9JqasJmAfszFMR1aCSjxBnZJcMxSIn
ssBwV0w2VH4IhjKxbcORPzMsp01++41zpO9LJlpH27ZKZWhZt3GGPmBjZD/pmrPrKdLOIJiJfPbG < /CipherValue >
         < /CipherData >
     < /EncryptedData >
 < /appSettings >

 

Decryption

Write Down Following Command

aspnet_regiis.exe -pd "appSettings
" -app  "/You Webapplication Name"



So After Apply Descryption your App Setting Looks Like :-

< appSettings>
     < add key="idbadge" value="Data Source=Comp-7;Initial Catalog=idbadge;Integrated Security=true;" / >
     < add key="path_photo" value="http://comp-7/WebCam_Last1/Webcam_Test_1_0_0_20.application?idbadge=" / >
     < add key="CrystalImageCleaner-AutoStart" value="true" / >
     < add key="CrystalImageCleaner-Sleep" value="60000" / >
     < add key="CrystalImageCleaner-Age" value="120000" / >
 < /appSettings >




 



Prev Post                                                      All Post                                                           Next Post



Posted in | 0 comments

Encryption and Decryption Class In .Net.

Encryption and Decryption
There are many times Required to Descrypt Data and Stored
Data in Database Like User name and Password And 
When We Retrive That Data We Needs to Encrypt That Data.
Following Code Show How to Encrypt and Descrypt Data in Asp.Net



  public string Encry(string str)
    {
        string Tmp = "";
        int i;
        for (i = 0; i <= str.Length - 1; i++)
        {
            Char ch = Convert.ToChar((str.Substring(i, 1)));
            int asc_from_ch = ch;
            int asc2 = Convert.ToInt32(asc_from_ch) + 7;
            Char ch_from_asc = Convert.ToChar(asc2);
            Tmp = Tmp + ch_from_asc;

        }
        str = Tmp;
        return str;
    }

    public string Decry(String str)
    {
        string Tmp = "";
        int i;
        for (i = 0; i <= str.Length - 1; i++)
        {
            Char ch = Convert.ToChar((str.Substring(i, 1)));
            int asc_from_ch = ch;
            int asc2 = Convert.ToInt32(asc_from_ch) - 7;
            Char ch_from_asc = Convert.ToChar(asc2);
            Tmp = Tmp + ch_from_asc;

        }
        str = Tmp;
        return str;
    }

Call This Two Function From your Form.

ENJOY !!!!!!!!!!!!!!!!! 
 
 
Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

TreeView Example In Asp.net 2.0

Write Down Following method in TreeNodePopulateEvent Of TreeView
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
    {

        PopulateSubLevel(Int32.Parse(e.Node.Value), e.Node);
    
    }


Write Down Foloowing Code in Page Load.
 protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            PopulateRootLevel();
          
        }
    }

For Populate Root Node
protected void PopulateRootLevel()
{
    con.Open();
    SqlCommand command = new SqlCommand(Query For Populate Root Node, con);
    SqlDataAdapter adapter = new SqlDataAdapter(command);
    DataSet RootTable = new DataSet();
    adapter.Fill(RootTable);
    PopulateNodes(RootTable.Tables[0], TreeView1.Nodes);
    con.Close();

}

Ser Text And Value For Each Parent Node.

    protected void PopulateNodes(DataTable dt, TreeNodeCollection nodes)
    {
        
        foreach(DataRow row in dt.Rows)
        {
            TreeNode tn=new TreeNode();
            tn.Text = "Text For Node"
            tn.Value = Value For Node ex. row["vacany_code"].ToString();
            nodes.Add(tn);
            tn.PopulateOnDemand = true;
          
        }
        
    }

Populate Child Node and Set Text And Value Field For Chid Nodes.

    protected void PopulateSubLevel(Int64 parent_id, TreeNode parent_node)
    {
        if (parent_id != 0)
        {
            con.Open();
            SqlCommand command = new SqlCommand(Query For Child, con);
            command.Parameters.Add("@employer_id", SqlDbType.Int).Value =
            parent_id;
            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ChildDataSet = new DataSet();
            adapter.Fill(ChildTable);
            TreeNodeCollection nodes = parent_node.ChildNodes;
            foreach (DataRow row in titlesForAuthors.Tables[0].Rows)
            {
                TreeNode tn = new TreeNode();
               
                tn.Text = "Text For Child Node
                tn.Value = "Value For Chid Node";
                nodes.Add(tn);
                tn.PopulateOnDemand = false;
            }
            con.Close();
          }
    }


Enjoy !!!!!!!!!!!!!!!!!!




Prev Post                                                      All Post                                                           Next Post



Posted in | 2 comments

Tab Control In ASP.Net Without third Party Controls




-> Tab Menu in ASP.Net can Be Archived by DIV. In this We Need two Div (First Consider Tab with 2 Menu)Put this Two DIV in Table and First Row of Table Divide in two column, Name This two Column As You Wish For Example In Below Screen Short There Are Two column Name Given Candidate(s) Suitable For You and Candidate(s) Forward by you.On Clicking of Individual Column Name We need to Hide or Show Div




 Now Write Down Below Code in First Cell click that means on Candidate(s) Suitable For You
 Click.

< td  id="celltech" class="MenuTabSelected" onclick="ShowTabContent('tech');HideTabContent('post');" style="width: 300px; height: 22px" >
               Candidate(s) Suitable For You < /td >



On Second Cell Click
< td  id="cellpost" class="MenuTab" onclick="HideTabContent('tech');ShowTabContent('post');" style="width: 300px; height: 22px" >
                            Candidate(s) Forward by you < /td >


And Write Down Following Java Script






< script type="text/javascript" language="javascript" >
        function ShowTabContent(TabID)
        {
        
            var TabControl=document.getElementById('cell' + TabID);
            var Tabdiv =document.getElementById('dv' + TabID);
            Tabdiv.style.display='block';
            TabControl.className='MenuTabSelected';
            return false;
        }
        function HideTabContent(TabID)
        {
        
            var TabControl=document.getElementById('cell' + TabID);
            var Tabdiv =document.getElementById('dv' + TabID);
            Tabdiv.style.display='none';
            TabControl.className='MenuTab';
            return false;
        }
      < /script >

Write Down Following code on Before Table Start. < script type="text/javascript" > ShowTabContent('tech');HideTabContent('post'); < /script > So Now your Tab control Ready Just See Below screenshot. CSS FOR Active\Deactive
.MenuTab
{

   color:black; 
   background-color  :#dce7f1;
   height :25px;
 font-size: 8pt;
 font-family: verdana;
 font-weight: bold;
 border: None;
 color:black;
    text-transform:uppercase;
 cursor:pointer;

    
}
.MenuTabSelected
{

  color :White; 
  background-image :url("./images/mainbg.jpg");
  height :28px;
    text-align:center; 
    vertical-align:middle;
 cursor:pointer;
 
 font-family:Verdana;
 font-size:12px;
 font-weight:bold;
   
   
}
 
 
 
Just take Image From your collection

Enjoy !!!!!!!!!!!!!



Prev Post                                                      All Post                                                           Next Post



Posted in | 0 comments

Open Child Window From Parent Window using Java script and closing

in parent Window


   Response.Write(" < script > window.open('Vacancy_Detal.aspx?lbl_vac_code=" + vac_code.Text + "','','left=150px,top=70px,width=812,height=650,scrollbars=yes,toolbar=0,resizable=0,location=no,status=no'); < /script > ");
  

In Child Window

    Response.Write(" < script > window.opener.location.href='Vacancy_Detal.aspx ';  < /script > ");
        Response.Write(" < script > self.close();  < /script > ");



Open Pop up Window From Java Script

< script  language="javascript" type="text/javascript" >
function showSMSPopUp(ctrl)
{
window.open('Job_search_Detail.aspx?vac_code=' + ctrl + '','','left=20px,top=70px,width=830,height=650,scrollbars=yes,toolbar=0,resizable=0,location=no,status=no');
return false;
}
< /script >


Closing Popup Window On Server Side.

Response.Write("< script  > this.close(); window.open('Tell_Frd_Vacancy.aspx?vac_code=" + vacancy_code + "','','left=20px,top=70px,width=828,height=650,scrollbars=yes,toolbar=0,resizable=0,location=no,status=no'); < /script >");


Prev Post                                                      All Post                                                           Next Post



Posted in | 0 comments

Maintain Checkbox state In GridView While Paging in ASP.Net


There Are Most Cases when we required checkbox In grid view and Also Paging. But there are Problem Exists if We Used Paging And Checkbox Field When We Go Next Page Then Page Post back to Server and All Checked Value clear so There are Required to Maintain all checkbox
Value.
I take one Problem which exists with me when I am developing one job site during developing this site I come on point to maintain checked value. User search jobs there are lot’s of jobs So all jobs
Display in Grid view I have checkbox in Gridview.Now when user select multiple job and save I need to maintain all paging checked Data. I have Archived this one by following method.
First Of All when we Changed Page Or Press Submit button We Need to Stored All Checked Data. And Pressing Submit button Save Data From that Storage.
On Select Page Index Changing Event I Call Two Method.
After Gridview Bind called PupulateoldCheckValue Metohd
And On Page Index Changing called StoreOldValue Method.
private void StoreOldValue()
    {
        ArrayList categoryIDList = new ArrayList();
        foreach (GridViewRow row in grd_search_result.Rows)
        {
            Label can_id = (Label)row.FindControl("lbl_vacancy_code");
            bool result = ((CheckBox)row.FindControl("chk_select")).Checked;

            // Check in the Session
            if (Session["CHECKED_ITEMS"] != null)
                categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
            if (result)
            {
                if (!categoryIDList.Contains(can_id.Text))
                    categoryIDList.Add(can_id.Text);
            }
            else
                categoryIDList.Remove(can_id.Text);
        }
        if (categoryIDList != null && categoryIDList.Count > 0)
            Session["CHECKED_ITEMS"] = categoryIDList;
    }





    private void PupulateoldCheckValue()
    {
        ArrayList categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
        if (categoryIDList != null && categoryIDList.Count > 0)
        {
            foreach (GridViewRow row in grd_search_result.Rows)
            {
                Label can_id = (Label)row.FindControl("lbl_vacancy_code");
                if (categoryIDList.Contains(can_id.Text))
                {
                    CheckBox myCheckBox = (CheckBox)row.FindControl("chk_select");
                    myCheckBox.Checked = true;
                }
            }
        }
    }




Prev Post                                                      All Post                                                           Next Post



Posted in | 3 comments

Desktop Application run from web application on server And Also Pass Argument

 →  First Publish your Desktop application on server
  
→  So Now you can run your desktop application online.
 → And After Publish Desktop application you can runt that application from your browser.


   PASSING PARAMTER TO PUBLISH DESKTOP APPLICATION FROM WEB APPLICATION



 →  First Publish your Dektop application so your publish folder contain  APPLICATIONNAME.application


 →  after that open your VS 2005 Command Propmt.

→  Run the Command mageui


 →  So Window open which shown Below screen short.




 → Now open APPLICATIONNAME.application   File from open Window  The Application File Which Resides On Server


 →  Now From Left Pannel Go on Deployment Open And Check on Allow Url Parameter ,  Screen Short Shown Below.


 →  Now in Desktop Application in Which you Need Query String paramter Just Write Down Below Code On Load.






private string GetQueryStringParameters()
    {
        NameValueCollection nameValueTable = new NameValueCollection();
        if (ApplicationDeployment.IsNetworkDeployed)
        {
            string queryString = ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
            string[] arInfo = new string[4];
            char[] splitter = { '=' };
            arInfo = queryString.Split(splitter);
            return arInfo[1].ToString();
        }

        else
        {
            return "";
        }
    }

→ I need only One Argument So I Do this You Can Get collection of Argument

                                if you have any question and suggestion Then write Down in commentBox.



Prev Post                                                      All Post                                                           Next Post



Posted in | 0 comments

CrystalReport 10.0 Dynamic Image Display Problem

CrystalReport 10.0 Dynamic Image Display Problem




To Display Dynamic Image in Crystal Report 10.0 Do The Following

Add BytesArray Column in DataTable For Image.

Then Just Convert your Image to Bytes Array.

Now just Drag and Drop that Bytes Array.

Now your Solution Work But there are many user getting that image can not diaply in Crystal Report 10.0
For that Just Add Folowing Code in Web.Config



< /system.web >
< httpHandlers > < add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/ > < /httpHandlers >
< /system.web >


Enjoy .......


Prev Post                                                      All Post                                                           Next Post

Posted in | 1 comments

Sending Email Using ASP.Net 2.0

Sending Email Using ASP.Net 2.0
Add Belowe Name Space to Access All Class and Methods Which Are Needed for Sending Mail.
using System.Net.Mail;
Write Down Following Code on Button Click
MailMessage msg = new MailMessage();
msg.From = new MailAddress("youaddress@yourdomain.com");
msg.To.Add(new MailAddress("sent@domain.com"));
msg.Subject = "Message Subject";
msg.Body = "Mail body content";
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
SmtpClient c = new SmtpClient("domain smtp server");
c.Credentials = new System.Net.NetworkCredential("user@domain.com", "userpassword");
c.Send(msg);
While Developing and Testing this Module there are Verious Problem Exisits it's mainly Security and SMTP Configuration
Related if you Found any Problem then let me know that Once.


Prev Post                                                      All Post                                                           Next Post


Posted in | 3 comments

Merge Cell in GridView Header ASP.Net 2.0

Merge Cell in GridView Header ASP.Net 2.0

Here i am going to see one of the best method to do that. To have additional header, we need to add one GridViewRow of header type to GridView inside OnRowCreated event method. The code snippet for doing this,
protected void GridView_Merge_Header_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
//Build custom header.
GridView oGridView = (GridView)sender;
GridViewRow oGridViewRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell oTableCell = new TableCell();
//Add Department
oTableCell.Text = "Writen Test Result";
oTableCell.ColumnSpan = 4;
oGridViewRow.Cells.Add(oTableCell);
//Add Employee
oTableCell = new TableCell();
oTableCell.Text = "Verbalk Test Result";
oTableCell.ColumnSpan = 4;
oGridViewRow.Cells.Add(oTableCell);
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}


Prev Post                                                      All Post                                                           Next Post



Posted in | 1 comments

Highlighting the current menu item From Collection of menu In Asp.Net 2.0 Menu Control

Highlighting the current menu item From Collection of menu Items In Asp.net 2.0 Menu control

In Asp.Net 2.0 Menu There Are Often Required to Highlight Current Selected Menu Item. There are various Way to Do it.One Method For Doing This One Describe Below.
string ThisPage = Page.AppRelativeVirtualPath;
foreach (MenuItem ParentMenu in Menu2.Items)
{
if (ParentMenu.NavigateUrl == ThisPage)
{
ParentMenu.Selected = true;
}
else
{
foreach (MenuItem childMenu in ParentMenu.ChildItems)
{
if (childMenu.NavigateUrl == ThisPage)
{
childMenu.Selected = true;
}
}
}
}

Prev Post                                                      All Post                                                           Next Post

Posted in | 1 comments

Coding to populate state and city Acording to country Without Post back In Asp.net

Here I Show how to Fill Country,State and city.State Depend On Country So
if Country changed then State Dynamically Changed Without Postback.Similar City Depend on state So if We Change State then need to city also changed this can be done in asp.net without postback with
following methods :
In Asp.net We Need to Register Script so later we can call this Function
Write down Following code in .Cs
protected void country_fill()
{
DataSet Search_dataset = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter("(select state_code,state_name,country_code from state_master) (select city_code,city_name,state_code from city_master)", con);
sda.Fill(Search_dataset);
string str = "";
str = " < script language=" + '"' + "javascript" + '"' + " > \n";
str += "var state = Array(" + (Search_dataset.Tables[0].Rows.Count + 1) + ");\n";
str += "var city = Array(" + (Search_dataset.Tables[1].Rows.Count + 1) + ");\n";
str += "function createarray(){\n";
str += "var i;\n";
str += "//create item array \n";
str += "for(i=0;i<>
str += "var a = new Array(3);\n";
str += "state[i] = a; }\n";
int i = 0;
foreach (DataRow Objdrow in Search_dataset.Tables[0].Rows)
{
str += "state[" + i + "][0]='" + Objdrow["state_code"] + "';\n";
str += "state[" + i + "][1]='" + Objdrow["state_name"] + "';\n";
str += "state[" + i + "][2]='" + Objdrow["country_code"] + "';\n";
i += 1;
}
str += "var j;\n";
str += "//create item array \n";
str += "for(j=0;j<>
str += "var b = new Array(3);\n";
str += "city[j] = b; }\n";
i = 0;
foreach (DataRow Objdrow1 in Search_dataset.Tables[1].Rows)
{
str += "city[" + i + "][0]='" + Objdrow1["city_code"] + "';\n";
str += "city[" + i + "][1]='" + Objdrow1["city_name"] + "';\n";
str += "city[" + i + "][2]='" + Objdrow1["state_code"] + "';\n";
i += 1;
}
str += "}\n"; //end of function
str += " < /script > \n";
//Page.RegisterClientScriptBlock("fill_item", str);
Page.RegisterClientScriptBlock("fill_item", str);
}
Now in ASpx Page On combo Box Changed Write Down following Code.
function fill_spec() //handle keyup on model_name
{
var selectcmb_func,spec_array_length,selectfunc_id,selectcmb_spec,selecttxt_spec_id;
spec_array_length = state.length;
selectcmb_func = document.forms.DropDownList1;
selectcmb_func=document.getElementById("");
selectcmb_spec = document.getElementById("");
selectfunc_id = selectcmb_func.options[selectcmb_func.selectedIndex].value;
numShown=0;
selectcmb_spec.length=0;
selectcmb_spec[numShown] = new Option("-- Select State -- ","0");
numShown++;
for(i = 0; i <>
{
if( (state[i][2]==selectfunc_id) || (state[i][2]==0))
{
selectcmb_spec[numShown] = new Option(state[i][1],state[i][0]);
numShown++;
}
}
}
function fill_city() //handle keyup on model_name
{
var city_length,ddl_state,ddl_city,id,numShown;
city_length = city.length;
ddl_state=document.getElementById("");
ddl_city = document.getElementById("");
id = ddl_state.options[ddl_state.selectedIndex].value;
numShown=0;
ddl_city.length=0;
ddl_city[numShown] = new Option("-- Select City -- ","0");
numShown++;
for(i = 0; i <>
{
if( (city[i][2]==id) || (city[i][2]==0))
{
ddl_city[numShown] = new Option(city[i][1],city[i][0]);
numShown++;
}
}
}
hear you need to call function createarray .You can call this function in page load.


Prev Post                                                      All Post                                                           Next Post


Posted in | 0 comments

Share Good Documents

.NET Framework Security
Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication
http://msdn.microsoft.com/en-us/library/aa302415.aspx




Prev Post                                 All Post                                                Next Post




Posted in | 3 comments

Convert Image to ByteArray And ByteArray to Image in Asp.Net

Convert Image to ByteArray And ByteArray to Image in Asp.Net


Convert Image to ByteArray
Following code Convert PictureBox image (You can take manually image from any folder) to ByteArray
MemoryStream ms = new MemoryStream();
this.pictureBox2.Image.Save(ms, ImageFormat.Jpeg);
// now save the stream as a byte array
Byte[] imageBytes = new Byte[ms.Length];
ms.Seek(0, SeekOrigin.Begin); // must rewind from the write
ms.Read(imageBytes, 0, (int)ms.Length);
ms.Close();
Now imageBytes Contains Image as a ByteArray.
Convert ByteArray to Image
Now Convert Above Bytearray in to Image.
System.IO.FileStream ms = new System.IO.FileStream(path_name + id_badge + ".jpg", System.IO.FileMode.Create, System.IO.FileAccess.Write);
//Where you Want to Save Image
//You Can Also Save In Control
ms.Write(imageBytes, 0, imageBytes.Length);
ms.Close();


Prev Post                                                      All Post                                                           Next Post


Posted in | 3 comments

Open Child Window From Parent Window using Java script , Refresh Parent When Child Window Closed.

in parent Window

Response.Write(" < script > window.open('Vacancy_Detal.aspx?lbl_vac_code=" + vac_code.Text + "','','left=150px,top=70px,width=812,height=650,
scrollbars=yes,toolbar=0,
resizable=0,location=no,status=no'); < /script > "
);
In Child Window
Response.Write(" < script > window.opener.location.href='Vacancy_Detal.aspx '; < /script >");
Response.Write(" < script > self.close(); < /script >");


Prev Post                                                      All Post                                                           Next Post

Posted in | 1 comments

Book Mark In ASP.Net

Book Mark In ASP.Net


After Performing Some action in Asp.net application There are Required to jump on Specific
Control or Specific Part of Page.It's Can Be archive by Following method.

Write Down Following code in ASP.net .Aspx Source Code.

< a name="jumphere1" > < /a >

Write down following Code in .Cs File



     private void registerAnchorScript(String strAnchorID)
    {
        String Script = "";

        Script += " < script language=JavaScript id='BookMarkScript' > ";
        Script += "var hashValue='#" + strAnchorID + "';";
        Script += "if(location.hash!=hashValue)";
        Script += "location.hash=hashValue;";
        Script += " < /script > ";
        Response.Write(Script);
        if (Page.IsStartupScriptRegistered("BookMarkScript"))
        {
            Page.RegisterStartupScript("BookMarkScript", Script);
        }

    }
Write Down Following Code in Some Event's Like Page Load,Click or else from where you
want to jump on specific Part of page.


registerAnchorScript("jumphere1");



Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Submit your Idea.

If you have any logic or tricks on .net Then Please Post on Below comment Box I make it Proper Post and Format and if you Want to give email id for discussion then it's also Nice for Reader.please if possible then give your name or contact so in post i write it.
Thank you in advance.


Prev Post                                                      All Post                                                           Next Post



Posted in | 1 comments

ASK Your Question.

Lets Discuss your Difficulty Here.


Prev Post                                                      All Post                                                           Next Post 

Posted in | 7 comments