Posts

Showing posts from June, 2017

Edit profile and photo c#

  private void getUserPhoto()     {         try         {             var adminpersonalinfodetails = GetAdminData().ToList();             var data = (from a in adminpersonalinfodetails                         where a.IsActive == true && a.AdminLogin_ID == loginId                         select a).ToList();             if (data.ToList().Count() != 0)             {                 userprofilephoto1.ImageUrl = data.ToList()[0].AdminPersonalInformation_ImageThumbnail;                 userprofilephoto3.Src = data.ToList()[0].AdminPersonalInformation_ImageThumbnail;           ...

blob upload with thumbnail c#

   protected void RadAsyncUpload2_FileUploaded1(object sender, FileUploadedEventArgs e)     {         string path = SaveCompanyPhoto(e.File).Result;         string path1 = SaveCompanythumbPhoto(e.File).Result;         var report = txtreport.Text;         //documentsentity.BookAppointmentDocumentDetails_Report = txtreport.Text;         if (Session["Att"] == null)         {             if (dtProductList.Columns.Count == 0)             {                 dtProductList.Columns.Add("Image", typeof(string));                 dtProductList.Columns.Add("Thumb_Img", typeof(string));                 dtProductList.Columns.Add("Date", typeof(DateTime));     ...

In a row only one cloumn update inc#

  BookAppointment personalinfo = GetAppointmentlist().FirstOrDefault(x => x.BookAppointment_ID == id);                      personalinfo.BookAppointment_Message = RadTextBox2.Text;             //personalinfo.InsertedBy = id;             personalinfo.InsertedOn = DateTime.Now;             personalinfo.IsActive = true;             personalinfo.IsDelete = false;             HttpResponseMessage content = client.PutAsJsonAsync("BookAppointment/" +id, personalinfo).Result;

Referesh the page

Response.Redirect(Request.RawUrl);

open aspx page popup window using asp.net c#(onclick event)

protected void showBtn_Click(object sender, EventArgs e)     {         string url = "../Admin/DuctorPrescriptionDetails.aspx";         string s = "window.open('" + url + "', 'popup_window', 'width=1200,height=500,left=100,top=100,resizable=no');";         ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);     }

open aspx page popup window using asp.net c#(commandname)

<telerik:RadButton ID="showBtn" runat="server" Text="Show" BackColor="#3399ff" ForeColor="Black" CommandName="Openfile"></telerik:RadButton>  if (e.CommandName.ToString() == "Openfile")         {              GridDataItem item = (GridDataItem)e.Item;             string value = item["ID"].Text;             string url = "../Admin/DuctorPrescriptionDetails.aspx?Patient_Id=" + value;             string s = "window.open('" + url + "', 'popup_window', 'width=790,height=400,left=100,top=100,resizable=no');";             ScriptManager.RegisterStartupScript(this, typeof(string), "script", s, true);          //   ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.o...

open aspx page popup window using javascript

<telerik:RadButton ID="showBtn" runat="server"  Text="Show" onclick="funAddr()" ></telerik:RadButton> <script type="text/javascript">         var winRef; //This holds the reference to your page, to see later it is open or not         function funAddr() {             var url = '../Admin/DuctorPrescriptionDetails.aspx';             if (typeof (winRef) == 'undefined' || winRef.closed) {                 //create new, since none is open                 winRef = window.open(url, "_blank", 'location=yes,height=600,width=970,left=300,top=35, scrollbars=yes,status=yes');             }             else {                 try {                 ...

After entity upadte

 this.Configuration.ProxyCreationEnabled = false;  public AdminEntities()             : base("name=AdminEntities")         {             this.Configuration.ProxyCreationEnabled = false;         }

Asp.net validation in web.config & footer part

<system.webServer>     <validation validateIntegratedModeConfiguration="false" />   </system.webServer>    <appSettings>   <add key="APIPath" value="http://drpradeeptasekharapiservice.azurewebsites.net/api/" />     <!--ForKencommerce-->     <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />    </appSettings> <div id="copy">                 <div class="container">                     <div class="row m0 footer_bottom">                                               <div class="fright copyright" style="float: left; font-size: 11px; color: #fff; padding-top: 1em; padding-bottom: 1em;">Copyright &copy;  <a href="ind...

last login date and time

  public void RetriveLastLogInInfo()         {             HttpResponseMessage usr = client.GetAsync("MasterLoginHistory").Result;             if (usr.IsSuccessStatusCode)             {                 MasterLoginHistory = usr.Content.ReadAsAsync<List<Master_Login_History>>().Result;                 if (MasterLoginHistory != null)                 {                     if (MasterLoginHistory.Where(a => a.Login_User_ID == Convert.ToInt32(Session["PartnerLoginUserID"])).Count() > 1)                     {                         var LogHistoryId = (from a in MasterLoginHisto...

FAQ BIND

public void FaqBind()     {         try         {             var content = GetContactUslist().ToList();             var result = (from a in content                           where a.IsActive == true && a.ContactUs_Comments != null && a.ContactUs_Answer != null                           select new                           {                              a.ContactUs_ID,                             a.ContactUs_Comments,                             ...

Header And footer

<title>!~ Welcome to Login ~!</title>  <div class="footer">                 <p>&copy; 2017 | All rights reserved | Design by <a href="http://www.swashconvergence.com">www.swashconvergence.com</a></p>             </div>

call API in ur aspx.cs Page

    HttpClient client = new HttpClient();   var appsurl = ConfigurationManager.AppSettings["APIPath"].ToString();         client.BaseAddress = new Uri(appsurl); and method is accesing ur API method is:  BookAppointment bookappointmententity = new BookAppointment();  HttpResponseMessage content = client.PostAsJsonAsync("BookAppointment", bookappointmententity).Result;

using Javascript clear the txtbox in onclick event & disable past date using jquery Datepicker

 <script type="text/javascript">         $(function () {             $('#txtdate').datepicker('setStartDate', new Date());             $('#txtdate').datepicker({             }).on('change', function () {                 $('.datepicker').hide();                           });         });               </script>     <script>         function GetClear() {             debugger             document.getElementById('txtfName').value = "";             document.getElementById('txtdate').value = "";             document.getElementById('txtemai...

Mobile number validation

<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ValidationExpression="^[7-9][0-9]{9}$" ControlToValidate="txtphno" ErrorMessage="Enter valid Mobile Number" ValidationGroup="contactUS" ForeColor="Red"></asp:RegularExpressionValidator>

Create your own captcha image generator in asp.net using c#.net

GenerateCaptcha.aspx <% @   Page   Language ="C#"   AutoEventWireup ="true"   CodeFile ="GenerateCaptcha.aspx.cs"   Inherits ="GenerateCaptcha" %> <! DOCTYPE   html   PUBLIC   "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html   xmlns ="http://www.w3.org/1999/xhtml"> < head   runat ="server">      < title ></ title > </ head > < body >      < form   id ="form1"   runat ="server">      < div >          </ div >      </ form > </ body > </ html > GenerateCaptcha.aspx.cs using  System; using  System.Collections.Generic; using  System.Linq; using  System.Web; using  System.Web.UI; usin...