ASP.NET

124K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

Share tech news, updates, or what's on your mind.

Sign up to Post

I have an asp.net web application and another internal asp.net website (not open to public) deployed as a rest service.
I want to create a proxy page in my public asp.net application , such that, say
(example contrived for the questions)

when a get request is made with a url parameter -- > http://ck.com/myproxypage.aspx?queryparameter=somevalue,
depending upon the queryparameter, i call internal rest api,  and forward the response to the caller.

the response from the api, could be one file, or multiple files such as html, js and css files. it can be just a pdf file .
how would i get the response from api and forward all the content to the caller?
0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Hi there!

The code presented in my last post here:

https://www.experts-exchange.com/questions/29113749/Sending-E-mail-through-GoDaddy.html

works as expected, but I have to click a button to "make it happen".

What I really need is to call this page from another, so that it goes through the code, sends the email to the user, and goes to another page immediately.

I have tried to adapt my previous code, but it does not work. Error message:

-------------
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: 'txtTo' is not declared. It may be inaccessible due to its protection level.

Source Error:

Line 7:  
Line 8:              lblMsg1.Text = ""
Line 9:              txtTo.Text = " ... "                                                                                     
Line 10:             txtFrom.Text = " ... "
Line 11:             txtSubject.Text = " ... registration"

-------------

Could you please check the code below and tell me how should it be corrected?

Thanks,
fskilnik.

<%@ IMPORT namespace="System.Web.Mail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="VB" runat="server">
    Sub Page_Load()

            lblMsg1.Text = ""
            txtTo.Text = " 

Open in new window

0
Hi there!

The code below is all there is in a asp.net vb page, that is called when the user must receive an e-mail with registration data.

I am not familiar with asp.net , therefore I created the page based on some googling...

It doesn´t work, but I believe (and hope) the error is simple. Could someone change it to make it work?  

Thanks,
fskilnik.

<%@ Page Language="VB" %>
	
<!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">

<%@ Import Namespace="System.Net.Mail" %> 
	
<script runat="server"> 
    
    MailMessage msg = new MailMessage();
        msg.From = new MailAddress(TxtEmail.Text);
        msg.To.Add("[b]contact@hostandservers.com[/b]");
        msg.Subject = TxtSub.Text;
        msg.Body = TxtMsg.Text;
        msg.IsBodyHtml = true;
        // MailMessage instance to a specified SMTP server
        SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);
        smtp.Credentials = new System.Net.NetworkCredential([b]"yourgodaddyemailusername, "godaddyemailpassword"[/b]);
        smtp.EnableSsl = false;
     
        // Sending the email
        smtp.Send(msg);
        // destroy the message after sent
        msg.Dispose();
        LitMsg.Text = "Thanks for email us.. will get back ASAP..!";
        TxtEmail.Text = "";
        TxtMsg.Text = "";
        TxtSub.Text = "";
        TxtName.Text = "";
</script> 
<html> 

Open in new window

0
What is the difference between ASP.NET Web Application Visual C# (.NET Framework) and ASP.NET Web Application(.NET Framework) Visual Basic when it comes to developing a web page.  I am trying to convert a desktop VB6 application and want to start off on the right ASP development page.  I am in the process of learning Visual Basic again.  

Also, I see a .NET Core version, so what exactly am I looking at as this can be quite confusing as to where I should begin?
0
In Visual studio, is it possible to make a Windows Form Desktop application that can also be executed from a Mac?  Or can that only be done from making a web page such as ASP.NET Web Application
0
On my page Default.aspx

I have a asp button like this:

<asp:Button ID="Button2" runat="server" Text="Button" />

On this page Default.aspx.cs

The server side click event for the button is this:

protected void Button2_Click(object sender, EventArgs e)
{

}

If I have a html button like this on this page Default.aspx

<input id="Button1" type="button" value="button" />

How do I call the Server-Side click event for it?
0
On my DevExpress ASP.NET Web Forms project hosted in Azure I have a XtraReport which prints fine on my development system and also tests OK at a company where I consult but my client, an administrator at a national construction company gets an Acrobat Reader error when the report is rendered to PDF and can't view or print it.

The only diagnostic info I have

She has asked her IT support to help but they may turn round and say it is down to my Web App.

Do you have any suggestions as to what is going wrong here?
0
I have a WebForms legacy application. When I run it in Visual Studio from any page other than login.aspx, I can never login. The execution comes to login.Page_Load(), but never reaches login.Submit_OnClick(). And I stay at the login screen. If I start the application from the login.aspx, everything works as expected. Could you please give me any idea on what is wrong? The application works on my machine's IIS. But if I run it on the server using VSTS, it works only if I explicitly enter url with /login.aspx.
0
I have an asp.net project . I want to version the JavaScript files, when there are any new changes to those files , so that browser downloads the latest .

Are there any tools/ nuget packages for this ?
0
Hi experts,

I saw this working ASP.net example:

https://www.c-sharpcorner.com/UploadFile/1e050f/edit-and-update-record-in-gridview-in-Asp-Net/

In that example when when you click on edit link of a row in the GridView, then all the items in the row become editable and then if you edit an item in the row you can then press the update button and it will update the record.

How can I revise that example to the following?:

on page load , show every row in the Name column in edit mode.
Then, above the GridView grid put a button that says Update.
So if I edit any of the names in any of the rows and then click that update button it will update the names I edited.

To summarize,
instead of having to click on each row one at a time and then update a name like the above example currently does, I just want to have the GridView launch with all the records in the Name column in edit mode, so I can simply make a Name change and then just click an update button one time to update the multiple names I edited.
0
Cloud Class® Course: Microsoft Azure 2017
LVL 12
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

When user send reply email , to specific email address, i need to update the Database value "yes"
if user reply  user reply.
0
I am converting my VB6 desktop app to VB.NET and ASP.NET so that I can "webify" the application I have.  What is the best way to begin learning?  I downloaded and installed the Community Edition of Visual Studio.  Should I start googling ASP.NET first or VB.NET first?  How will this actually play out?  Will I end up having to learn both at the same time since they are tied?  What exactly is the relationship between the two?

Also will I need to know HTML and any other languages?  At the end of the day, I am only looking to convert about 6 screens in my VB6 app to .NET so that it can be accessed from more users and even Mac users.

Thanks
0
Hi experts,

I'm using the Telerik UI for ASP.NET AJAX RadWindow.
https://demos.telerik.com/aspnet-ajax/window/examples/overview/defaultcs.aspx

I'm using ASP.NET and VB.

I saw this example here for passing a parameter from the Main page to the RadWindow:

Using RadWindow as a Dialog
https://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/using-radwindow-as-a-dialog

I recreated this example and it works fine.

This is the working code:

RadWindow1_MainPage.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RadWindow1_MainPage.aspx.vb" Inherits="RadWindow1_MainPage" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">

        // https://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/using-radwindow-as-a-dialog

        // The OnClientShow event handler sets the argument to the dialog being opened
        function clientShow(sender, eventArgs) {
            // When the showRadWindow1 button is clicked the value from the textbox is pass to RadWindow1 as an argument
            var txtInput = document.getElementById("txtInput");
            sender.argument = txtInput.value;
        }
        // The OnClientClose event handler receives the result of the dialog and responds
        function clientClose(sender, args) {
        

Open in new window

0
I have a net 2.0 compact framework client that pulls data via an asp.net web service (also 2.0) . This is working fine until we try to connect to the web service on an encrypted link
https: Now I'm getting a web exception in the client, it does work if I change it back to http:

Is there something I need to put in the local.config file to support https? Something with the certificate I need to change or something else
Thanks
0
Im getting started to learn VB.NET and ASP.  I am coming from a background with some experience in VB6.  

What software tools do I need in order to develop a webpage with VB.NET and ASP?  Do I need a specific web server from Microsoft?  If so, what version?  Do I need Visual Studio?  If so, what version.  What is needed to begin setting up ASP?  Is that automatically built-in to the web server?

Also, what is the difference between ASP and ASP.net, if any?

Thanks
0
I am trying to use HttpClient in C# as below:

using (HttpClientHandler handler = new HttpClientHandler())
{
         handler.UseDefaultCredentials = true;

         using (HttpClient _httpClient = new HttpClient(handler))

Open in new window


I understand that HttpClientHandler has "UseDefaultCredentials" property.
so what is "UseDefaultCredentials"?
And if "UseDefaultCredentials" is set to true, what does that mean?
0
Can someone recommend a good image resampler?  I need to reduce the size of several jpeg files to be display in an ASP.NET application.
0
ASP.Net MVC 5

I am trying to fetch the result from Jquery to my controller.

However, in my controller - ActionResult is not invoking.   What could be the reason ?

        [HttpGet]
        public ActionResult ActionName(string id)
        {
            // do something
            var vm = id;
            return View(vm);
        }

JQuery Syntax :


   $('button').click(function () {
        var btn = $(this).attr('id');

        alert(btn);

        $.ajax({
            type: 'GET',
            url: '@Url.Action("ActionName", "ControllerName")',
            data: { id: btn },
            success: function (result) {
                // do something
            }
        });
    });
0
How to pass Jquery variable value to c# mvc?

I need to fetch the value of the variable btn in mvc code behind.

$("button").click(function ()
    {
        var btn = this.id;
        if (btn == "previewButton")
        {
          alert(btn);

        }
  }

Open in new window


Based on the variable value (Submit Button (or) Preview Button), my model will have Required validation on certain fields.
0
Cloud Class® Course: CompTIA Cloud+
LVL 12
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Can someone recommend a good image compressor?  I need to compress several jpeg files to be display in an ASP.NET application.

Thanks
0
How to fetch HTML Input Id in code behind ASP.Net MVC ? Either on Controller or on Model ?

 view / .cshtml 

<button type="submit" id="previewButton" >Preview</button>

JQuery : - This will not be in use.

$("button").click(function ()
    {
        var btn = this.id;
          alert(btn);
   }

In Controller :

[HttpPost]
        public ActionResult New(MyViewModel viewModel, string clickedButton)
        {
            
            var vm = clickedButton;
            return View(vm);
        }

- MyViewModel
 public string clickedButton { get; set; }

Open in new window

0
I just want to set up SMTP (with SendGrid) on Dynamics crm 2011 (On Premise) so I follow the following link.
My goal is to send email when e.g. lead is converted to WON...something similar workflow that I do know how to do that.

My question is. after I completed the set up accordlingly, am i completed or I have to do something else? and how to test it?


https://www.appliedis.com/a-cloud-solution-for-microsoft-dynamics-crm-2011-online/
0
How to handle Required field validation in Jquery for radiobuttons in asp.net mvc?

Currently, I am handling it in the Model
view \ create.cshtml page

   
<div class="col-sm-3 checkbox-inline">
                        @Html.RadioButtonFor(model => model.IsDateChanged, 1, new { @Id = "IsDateChangedYes" })
                        <label class="hthin" for="IsDateChangedYes">Yes</label>
                        @Html.RadioButtonFor(model => model.IsDateChanged, 0, new { @Id = "IsDateChangedNo" })
                        <label class="hthin" for="IsDateChangedNo">No</label>
                        <span asp-validation-for="IsDateChanged" class="text-danger"></span>
                    </div>

Open in new window



viewmodel \ mymodel.cs

 [Required(ErrorMessage = "Required")]
        [Display(Name = "1. Have there been any changes in the date?")]
        public int? HasDateChanged { get; set; }

Open in new window

0
Asp.net
Vb.net

A page with a list of transaction is loaded
A textbox
A command button

The visitor enters the email in the textbox and clicks the command button, as a result the currently displayed page is sent to the entered email

How to get the currently displayed page text, tags, script .....      in a string to be used for email body

The code is

        Dim smtp As New System.Net.Mail.SmtpClient()
        Dim smail As New System.Net.Mail.MailMessage
        smail.To.Add(New System.Net.Mail.MailAddress(TextBox1.Text))
        smail.From = New System.Net.Mail.MailAddress("MyEmail@gmail.com", "subject")
        smail.Subject = "Subject"
        smail.IsBodyHtml = "true"
        smail.Body = (this part is needed)
        smtp.EnableSsl = True
        smtp.Send(smail)

Thanks
0
Hi

In my ASP.net web app I want a user to be able to download an Excel file that I have in my resources.
What VB.net code would I use behind a  button click for this
The Excel file is called Steel.xls
It is a 97 to 2000 Workbook
0

ASP.NET

124K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications