ASP.NET

123K

Solutions

35

Articles & Videos

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

Dear Experts,
I am creating an online database portal that requires a user login.  Once logged in, the user has access to various pages, one of them will jump to a payment center of a bank.  (In my case, Union Bank, https://www.hoabankservices.com/Services.aspx)

Is there anyway that I can inject the userID from before jumping to this payment center, and have it automatically show up in User ID box?
Please advise.  Thank you.
0
PeopleSoft Has Never Been Easier
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

EgEgI have checkbox that when' Checked' sets the  value of the checkbox into a textarea.

    Protected Sub chkReviewdate_CheckedChanged(sender As Object, e As EventArgs) Handles chkReviewdate.CheckedChanged
        CheckActions()
        txtNotes.Text = "Review date to be added or incorrect"
    End Sub

Open in new window


The problem is that when more than 1 checkbox is checked it overwrites the value in   txtNotes.Text with the latest checkbox value

What I would like to do is list ALL the values of the 'Checked' checkboxes, not just the last one. Whats the best way to achieve this?
0
Hi,

I am looking at a few different things. I am using ASP.NET 4.0 and VB.NET code-behind.

The main situation is this.

I have a page with an iFrame.  We'll call that Page 1 and the page in the iFrame as Page 2. The page of the iFrame on Page 2 is a URL location is external and that page cannot change.

Page 1 is polling the database running on reload of the page which invokes the Page_Load on the reload. That Page_Load is executing the stored procedure to check certain values in a table. Page 2 (the one in the iFrame) is where certain information is entered and will have a submit button. After a period of time, information from the Page 2 will go into the same table that I am polling on Page 1.

What is going on is every time Page1 reloads (based on like 10 second interval) the data in Page 2 (in the IFrame) is lost.

How can I keep that from happening?

I can think of one way, off the cuff, and that is to use the Page 1 and Page 2 as a frameset. And one Frame (for the Page 1) is doing the polling and reloading... The other frame is doing the Page 2 but in an iFrame.

When the user hits the "Submit" button on the second frameset (Page 2) then break out of the frameset and only have the Page 1.

Break out of the Frameset from the code behind of Page2 with JavaScript like? Or is there another way?

Page.RegisterClientScriptBlock("ResetPage", "<SCRIPT>top.location.href=" + Page1URL + "</SCRIPT>");

Open in new window


That is one option. Is there another …
0
After finally getting assistance with my asp code and compiling so it runs properly on my desktop,  I copied files to hosting server and now I get this message from the server:


Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>
0
hi all
i want a line per ittem, please help

ObjSendMail.HTMLBody = "Nombre:" +" " + Request.Form("fname") & Chr(10) & "Email:" +" " + Request.Form("email") & Chr(10) & "Consultorio:" +" " + Request.Form("consultorio") & Chr(10) & "Comentarios:" +" " + Request.Form("message")

Open in new window


tsm
0
Hello I am new to asp and and trying to learn how to code properly however, I have a deadline to get this code to work on a clients website. My hosting company moved us to a new server that does not support FrontPage extensions and so i need to update my skills and update my websites I support.

I copied this code from one of the asp.net  sources and tweaked it with my variables but am still getting 5 errors when i debug it.

Error      1      Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.TextBox'      c:\users\melinda\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\Test_form.aspx.cs      27      30      WebApplication1
Error      2      Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Label'      c:\users\melinda\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\Test_form.aspx.cs      34      26      WebApplication1
Error      3      Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Label'      c:\users\melinda\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\Test_form.aspx.cs      40      26      WebApplication1
Error      4      Property or indexer 'System.Net.Mail.MailMessage.To' cannot be assigned to -- it is read only      c:\users\melinda\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\Test_form.aspx.cs      49      9      WebApplication1
Error      5      Cannot implicitly convert type 'System.Net.Mail.MailAddress' to 'System.Net.Mail.MailAddressCollection'      c:\users\melinda\documents\visual studio …
0
Hi,

How can I set a variable in JavaScript on an ASPX page but also have the contents available in the VB.NET code behind? This is for an ASP.NET 4 and VB.NET

I can set the variable in the JavaScript but it's not available in the code behind.

I can set it something like this:

 function SetUserName() {
            var myvar = document.getElementById('<%= TextBox1.ClientID %>').value
            '<%Session("LastName") = "' + myvar + '" %>';
            alert('<%=Session("LastName") %>');
        }

Open in new window


But when I try to get it from the code behind using like an Intermediate window I get like:

Session("LastName")  I like "' + myvar + '"

The alert is above in the javascript is showing the right thing. But that setting it apparently only happening on the ClientSide. How do/can I get it to happen on the client side but also on the server side or can I? Is this where Ajax come into play?

If so, how would something like that be done?

Any information would be greatly appreciated.
0
On a forum post, this user said that he was having problems with a 500 error on his API calls. So he said:
>>Using Fiddler, I'm seeing a page returned that is their "Site Down" page

How does one use Fiddler to test API calls? What is the website url to Fiddler? Because I find JSFiddle.net, but Fiddler.com takes me to a fiddling website.

thanks!
0
I have a Calendar control that works fine the way it is but now I have to add some functionality. I am using the DayWeek Selection mode. I have dates that have been saved, as weeks, in my database and I need to have these weeks selected in the control when it loads, so the user knows that these weeks have already been selected. And yes, I currently have a messagebox coming up to let the user know the week  has already been selected but I would like the visual representation as well.
Does anyone know how to do this? I know it has something to do with opening a dataset with the dates from the db into the SelectedDates() array(?) and comparing these against the current months dates(Or something like that).
Does anyone have some type of function that does this? It would help me out big time...

Thanks for any help offered!!
0
"Select * from [TableEditor].[dbo].[teFields] ORDER BY TableID where TableID = " + Convert.ToInt32(ddlTable.SelectedValue) + ""; statement
"Select * from [TableEditor].[dbo].[teFields] ORDER BY TableID where TableID = "39"; Correct
0
Creating Instructional Tutorials  
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Why do I get this error at line24 ??

Line 23:             //fill pg w data
Line 24:             lblPrice.Text = "Price per unit: <br/>$ " + detail.eventPrice;
Line 25:             lblTitle.Text = detail.eventDetailName;
Line 26:             lblDescription.Text = detail.eventDesc;
0
I have just a query that if i put required field validator in the forms and also wants to  enable a pop message that shows up ‘please complete the mandatory fields’, if any of the required field is not filled.
Will it be possible, that alert will generate
0
Hi Experts,

I have a textbox which accepts a date  for example "06/21/2017".
I use "prmDateClosed = New SqlParameter("@DateClosed", txtDateClosed.Text.Trim)" to save into the table. The data type of the field in the table is "Datetime". It saves in the table as "2017-06-26 00:00:00.000". When I retrieve it back in a gridview it displayes "6/21/2017 12:00:00 AM ". I just want to save in the table as "06/21/2017".  and retrieve as "06/21/2017".

Thanks in advance.
0
My Css is not applying . Here is the codes from code behind!!!

        //Get list of all products in DB
        EventDetail eventDetail = new EventDetail();
        List<EventDetail> details = eventDetail.getAllEventDetail();

        //Make sure events exist in database
        if (details != null)
        {
            //Create a new panel with an image button and 2 labels for each event
            foreach (EventDetail detail in details)
            {
                Panel eventPanel = new Panel();
                ImageButton imageButton = new ImageButton();
                Label lblName = new Label();
                Label lblPrice = new Label();

                //set childcontrols' properties
                imageButton.ImageUrl = "~/EventImages/Events/" + detail.eventImage;
                imageButton.CssClass = "eventImage";
       
                imageButton.PostBackUrl = "Detail.aspx?id=" + detail.EventDetail_ID;

                lblName.Text = detail.eventDetailName;
                lblName.CssClass = "eventName";

                lblPrice.Text = "$ " + detail.eventPrice;
                lblPrice.CssClass = "eventPrice";
               
                //Add child controls to panel
                eventPanel.Controls.Add(imageButton);
                eventPanel.Controls.Add(new Literal { Text = "<br />" });
                eventPanel.Controls.Add(lblName);
                eventPanel.Controls.Add(new Literal { Text = "<br …
0
Hello Experts,
My website is working fine until I add the following line.  The moment I try to run the website after the line has been added, I am getting the the error "Cannot open database "ASPState" requested by the login. The login failed.  Login failed for user 'userid'".  Any idea why it fails?  FYI, I am using c#.net in Visual Studio 2013.

Session["FirstName"] = "Krishna";

Thank you in advance.
0
Hi,

I am using Bing Maps V8. I have most activity in JavaScript with ASP.NET 4.0. The code behind, if applicable, is VB.NET.

But what is escaping me is there are several pins on a map and putting the pin is not a problem however getting the list of locations is.

I know Bing Maps V8 has the search but I'm searching for locations that are already pinned.

I need to zoom out to show the map with the area of all the pins.

How do I go about getting a list of all the pin locations to use to get the boundaries so I can zoom out the map?
0
I am using a webclient to send data via JSON to tell the server what I want to have them return to me. However, The API requires I use a GET. But I don't know how to define a GET in the UploadData or even DownloadString methods. How can I issue a GET at the same time I am also sending JSON?

If I pass all the parameters as query string parameters it also fails, so I have to issue the call using JSON data in the body.

thanks!
0
Is there a free option to host a asp.net project to test on web not on local host?
0
I am dynamically creating the row and cell structure within an asp:Table and need to access the data in the table. The dynamic creation is because there will be a variable amount of data in the table. The table creation is fine but I am not able to programmatically find the appropriate controls to access the data.

html code
                <table id="tblGoals" class="GoalsTable" runat="server">
                    <tr>
                        <td colspan="4">
                            <h3 class="Center">Goals</h3>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:Table ID="tblGoalDetails" CssClass="GoalDetails" runat="server" GridLines="Horizontal">
                            </asp:Table>
                        </td>
                    </tr>
                </table>

Open in new window


row and cell creation code
    //********************************************************************************
    // Name: LoadGoalsTable
    // Abstract: Loads goals for specific exercise in workout
    //********************************************************************************
    private void LoadGoalsTable(int intExerciseID)
    {
        int intGoalCounter = 0;
        string strGoalType;

        //look up goals for current exercize
        using (var myEntities = new dbWorkOutEntities())
        {
            var CurrentGoals = (from goals in 

Open in new window

0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

How can I get the User's public IP ?
I am using asp.net / vb
0
Hello Experts,

I'm using ASP.NET Core MVC, C#, Entity Framework Code First. I'm having trouble finding any tutorials or help with performing a Cascade on 2 DropDownList's.

I have a DropDownList called States that list all 50 States. I need to populate the second DropDownList called Cities based on the selected State value.

Can someone please assist me with this? Please see my attached Model and Controller.

Models
    public class State
    {
        public int StateId { get; set; }
        public string StateAbbr { get; set; }
        public string StateName { get; set; }

        public ICollection<City> Cities { get; set; }
    }

Open in new window


    public class City
    {
        public int CityId { get; set; }
        public int StateId { get; set; }
        public string CityName { get; set; }

        public State State { get; set; }
    }

Open in new window


ViewModel
    public class CitiesVM
    {
        public int CityId { get; set; }

        [Required(ErrorMessage = "Select State")]
        [Display(Name = "State")]
        public int StateId { get; set; }
        public IEnumerable<State> States { get; set; }

        [Required(ErrorMessage = "Enter City Name")]
        [Display(Name = "City Name")]
        [StringLength(50)]
        public string CityName { get; set; }
    }

Open in new window


Controller

States Controller

public class StatesController : Controller
    {
        private readonly CascadeContext 

Open in new window

0
I have a table that has many checkboxes.  If one of them is selected, I want to fire an event that sets the value of a dropdown list.   I've tried with the below code bus cannot get it to work

    End Sub
    Protected Sub chkLearnerName_CheckedChanged1(sender As Object, e As EventArgs)

        Dim ischeked As Boolean = False
        Dim cntrl As Control
        For Each cntrl In chkboxestbl.Controls

            If TypeOf cntrl Is CheckBox Then
                If CType(cntrl, CheckBox).Checked = True Then
                    ischeked = True
                    ddlRevResult.SelectedValue = 1

                Else
                    ddlRevResult.SelectedValue = 2

                    Exit For

                End If
            End If
        Next
    End Sub

Open in new window

<table id="chkboxestbl" runat="server" style="width: 100%; font-size: xx-small;">
                                              <tr runat="server">
                                                  <td runat="server"></td>
                                                  <td runat="server" ></td>
                                              </tr>
                                              <tr runat="server">
                                                  <td runat="server">
                                                      <asp:CheckBox ID="chkLearnerName" OnCheckedChanged="chkLearnerName_CheckedChanged1" runat="server" Text="Learner Name" AutoPostBack="True" />
                      

Open in new window

0
Greetings:

In my ASP.NET app there are occasions whereby the yellow error screen is displayed on a web browser. I would like to intercept these exceptions sending myself an e-mail about the exception and providing a simple, non-technical explanation to the user instead of a yellow screen and a message the user most likely will not understand.

I'm hoping most error messages have a unique error number by product. Product is IIS, SQL Server, ASP.NET, etc. In this case checking for an error number, and not the contents of an error message, will simplify coding.

I hope I've stated my question intelligently.

Much thanks in advance,
David Bach
0
I am developing an ASP.NET application using C#.

I use the following RegularExpressionValidator to try and accept only alphanumeric characters.
However, the application accepts "Special Characters".
Do you know what I am doing wrong?

<asp:TextBox ID="txtaccountNum"  runat="server" Text='<%# Eval("accountNum") %>'></asp:TextBox>  
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtaccountNum" Display="Dynamic" ErrorMessage="Account # is required" SetFocusOnError="true" ForeColor="Red" ValidationGroup="AllValidators"></asp:RequiredFieldValidator>                  
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server"
                           ErrorMessage="Enter alphanumeric characters only."
                           ControlToValidate="txtamount" ForeColor="#FF0066"
                           SetFocusOnError="true"
                           ValidationExpression="^[0-9a-zA-Z]+$">                  
                    </asp:RegularExpressionValidator>
0
I'm upgraded the asp.net page and I would like the current users redirect them to the upgraded version with different path.
So , I was thinking of creating a page with instruction to go to a new page with the upgrade version.

What methods or ways I can achieve this same purpose.?
Can this be done by modifying the web config file only or do I hecessarily have to create a page?
0

ASP.NET

123K

Solutions

35

Articles & Videos

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