Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all 3938 articles
Browse latest View live

Http to Https URL rewriting

$
0
0
My requirement is straight forward. I have installed certificate , in binding added thee certificate. site is working in Https(e.g. https://abc) as expected.

But the requirement is , if any user Enters http://abc then it should redirect to https://abc

I have added the URL rewriting module. Created the Rule. The web.config file code as below



<rewrite><rules><rulename="http to https"stopProcessing="true"><matchurl="(.*)"/><conditions><addinput="{HTTPS}"pattern="^off$"/></conditions><actiontype="Redirect"url="https://{HTTP_HOST}{REQUEST_URI}"redirectType="Found"/></rule></rules></rewrite>



Help out. Its not working.

TypeError: $(...).autocomplete is not a function

$
0
0
<scriptsrc="../js/jquery-ui.js"></script><linkhref="../js/jquery-ui.css"rel="stylesheet"/>



<input id="txtsearch" type="text" />



$('#txtsearch').autocomplete({
          source: '~/CategoryHandler.ashx'
      });


publicvoid ProcessRequest(HttpContext context)
        {
            string name = context.Request["Name"] ?? "";
            List<string> ls = new List<string>();
 
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                SqlCommand cmd = new SqlCommand("CategoryPro", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@action", "ShowCategoryName");
                cmd.Parameters.AddWithValue("@serchname", name);
                cmd.Parameters.Add("@msg", SqlDbType.VarChar, 500);
                cmd.Parameters["@msg"].Direction = ParameterDirection.Output;
 
                SqlDataReader dr = cmd.ExecuteReader();
 
                while (dr.Read())
                {
                    ls.Add(dr["Name"].ToString());
                
                }
 
            }
            catch (Exception ex)
            {
                throw ex;
 
            }
 
            finally
            {
                con.Close();
            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            context.Response.Write(js.Serialize(ls));
        }

ASP and SQL web application help

$
0
0
Hey guys, as of recent i have been learning ASP so i can create a web application for an existing SQL database. I'm just wondering how i could go about creating user login/logout , sessions , profile page , and registration pages. Im developing in visual studio community 2017.


Thanks.

Rich Textbox

$
0
0
how can I use rich textbox in web application without using third part

Anything new exist to test EF repository instead of Mock lib in .Net Core

$
0
0
please tell me anything new exist to test EF repository instead of Mock lib in .Net Core.
if possible please share some good article links. thanks

Object does not contain definition for substring.

$
0
0
I am trying to split fullname into firstname and lastname using the following:

<asp:Label ID="lblPurchOnwer" Text='<%#Eval("buyername") %>' Style="width: 450px;
                                                                        color: #0093B2; font-weight: bold;" runat="server"></asp:Label> 
C#
  var Buyernames = Eval("buyername");
  var bFName = Buyernames.Substring(0, Buyernames.IndexOf(" "));
  var bLName = Buyernames.Substring(Buyernames.IndexOf(" ") + 1);


but I am getting following error message:

'object' does not contain a definition for 'Substring' and no extension method 'Substring' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

Any ideas?

Thank you

Application Security Testing Tool to Check Security Vulnerability

$
0
0
Hello Everyone,

I am trying to purchase application security testing tool for my company. Any recommendation? Budget is around $1500. Few tools like

Arachni
netsparker
syhunt

thanks

c# crystal report asp.net

$
0
0
hi

I use asp.net/c# for my application, so I need to preview a report with crystal report but when printing the report I have to delete some labels from the report that means the preview and the printed report are not the same

Can any one help me, please

using asp.net c#

$
0
0
in my project image is uploaded and stored using file upholder. and i need to display image in image control (for eg: in facebook we are uploading profile picture when we logged out and login the profile picture will be displayed.)..i need tat kind ..pls give me suggestion

Code not displaying results in Repeater from the database

$
0
0
I have this highly complicated app that dynamically creates rows in Repeater.

I am doing this in both Repeater1 and Repeater2 controls.

When a user enters records and decides to exit to come back to finish later, we would like the user to enter an ID and have the data entered to display on the form so s/he can continue from where s/he left off.

I wrote a stored proc called getAllRecs with one input parameter called ID (integer).

I am trying to call the stored proc but when I do, entire screen is blank.
I am lost as to how to fix this.

Here are some code snips. Please let me know if I need to show more code:

SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand("sp_AllRecs", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter p1 = new SqlParameter("@ID", ID);
cmd.Parameters.Add(p1);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dtPreviousRecords = new DataTable();
sda.Fill(dtPreviousRecords);
Repeater1.DataSource = dtPreviousRecords;
Repeater1.DataBind();
Repeater2.DataSource = dtPreviousRecords;
Repeater2.DataBind();


In Repeater1, I have this:

<asp:TextBox ID="txtboatregNum" Text='<%#Eval("RegNo")%>' runat="server" placeholder="Enter registration #..." Style="width: 450px;" class="form-control">

In Repeater2, I have this:

sp:TextBox ID="mMake" Text='<%#Eval("MakeNo")%>'Style="width: 270px; margin-left: 175px;"runat="server"></asp:TextBox>


There are many more fields. I know I oversimplied it but just an example.

Any ideas what I could be doing wrong?

Does it have anything to do with positioning of the fields on the stored proc?

regarding asp.net

$
0
0
i need a chat in asp.net application as we are using in facebook. how it will be create?

Gridview with checkboxes

$
0
0
I have a gridview where I have checkboxes on each row. You can select the checkboxes and then hit a download button. The code returns back a multipaged pdf with the files you checkboxed.

How to do you use updateprogress to show the user that I am doing a process and to keep them from hitting download more than once. I tried with a button, but I am getting
Sys.WebForms.PageRequestManagerParserErrorException: 


When I try a link button, the PDF is generated and downloaded, but no ajax updateprogress is visible.

Thanks

File Upload and Export option with VS 2015

$
0
0
Hello,

I am using Visual Studio 2015, ASP.NET framework : 4.6.1

I am trying to do file upload and export to excel. both things were working fine in VS2010 but same form, same codes are not working on VS2015.

We already configured the following :-

In webconfig :-
<appSettings><addkey="ValidationSettings:UnobtrusiveValidationMode"value="None"/></appSettings>


In Page :-
<Triggers><asp:PostBackTriggerControlID="SaveBtn"/></Triggers>


In Page Header :-
EnableEventValidation="false"


My codes are not generating any error, but even not working as expected in VS2015. If I just copy-paste the same page/code in VS2010 it will start working.

Remember : my scriptmanager is allocated in master file.

Any utilities for replicating Web Site files through intermediary drop into web site testing location.

$
0
0
I am working on a .NET Core product representing a web site server. There are HTML, JS, CSHTML, etc. files in the Team Foundation Services repository not necessarily organized in folders the same way they will end up on the system actually hosting the web site.

Is anyone aware of a utility that will take the source files, make a copy to an intermediate location, and then copy from the intermediate location to update the pages and files on the system hosting the web site?

I am changing the source files and want to see the changes reflected on the web site system, which is a VM that must be reached through an intermediate drop location. I can run the utility on the development system and the target system easily enough. It is a PITA to keep track of which files were modified and to keep copying the files by hand.

Just asking ahead of time, so I don't go rewrite the wheel.
I need a 32 bit unsigned value just to hold the number of coding WTF I see in a day …

regarding asp.net

$
0
0
i have created two image buttons and i have created positive and negative columns in sql. when i click the positive button,i need to increment the value in positive column in sql

regarding asp.net

$
0
0
i need a chat in asp.net application as we are using in facebook. how it will be create?

Gridview with checkboxes

$
0
0
I have a gridview where I have checkboxes on each row. You can select the checkboxes and then hit a download button. The code returns back a multipaged pdf with the files you checkboxed.

How to do you use updateprogress to show the user that I am doing a process and to keep them from hitting download more than once. I tried with a button, but I am getting
Sys.WebForms.PageRequestManagerParserErrorException: 


When I try a link button, the PDF is generated and downloaded, but no ajax updateprogress is visible.

Thanks

File Upload and Export option with VS 2015

$
0
0
Hello,

I am using Visual Studio 2015, ASP.NET framework : 4.6.1

I am trying to do file upload and export to excel. both things were working fine in VS2010 but same form, same codes are not working on VS2015.

We already configured the following :-

In webconfig :-
<appSettings><addkey="ValidationSettings:UnobtrusiveValidationMode"value="None"/></appSettings>


In Page :-
<Triggers><asp:PostBackTriggerControlID="SaveBtn"/></Triggers>


In Page Header :-
EnableEventValidation="false"


My codes are not generating any error, but even not working as expected in VS2015. If I just copy-paste the same page/code in VS2010 it will start working.

Remember : my scriptmanager is allocated in master file.

TypeError: $(...).autocomplete is not a function

$
0
0
<scriptsrc="../js/jquery-ui.js"></script><linkhref="../js/jquery-ui.css"rel="stylesheet"/>



<input id="txtsearch" type="text" />



$('#txtsearch').autocomplete({
          source: '~/CategoryHandler.ashx'
      });


publicvoid ProcessRequest(HttpContext context)
        {
            string name = context.Request["Name"] ?? "";
            List<string> ls = new List<string>();
 
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                SqlCommand cmd = new SqlCommand("CategoryPro", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@action", "ShowCategoryName");
                cmd.Parameters.AddWithValue("@serchname", name);
                cmd.Parameters.Add("@msg", SqlDbType.VarChar, 500);
                cmd.Parameters["@msg"].Direction = ParameterDirection.Output;
 
                SqlDataReader dr = cmd.ExecuteReader();
 
                while (dr.Read())
                {
                    ls.Add(dr["Name"].ToString());
                
                }
 
            }
            catch (Exception ex)
            {
                throw ex;
 
            }
 
            finally
            {
                con.Close();
            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            context.Response.Write(js.Serialize(ls));
        }

Trying to download code using GitExtensions

$
0
0
Hi,

I have been given a path of Git source Control folder which has git, hook, info etc folders inside it, I am trying to download the code hence I tried to Clone as suggested in a link, still it is putting .git folder inside my local folder which I have put as Destination and Subdirectory to Create, is there anything I am missing? Do I need to put any new SSH Key etc. I am really worried whom to ask because as there are many ways to download code using git maybe, its so much confusing. Its becoming hard and frustrating.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
Viewing all 3938 articles
Browse latest View live


Latest Images