Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

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 a Gridview control in which I am trying to load data from database into label controls of a GridView.  I am using datasource.databind and gridview.databind.

Can someone help please??!!?!?!?

Below is my code:
<asp:GridView ID="Layer1GridView" runat="server" AlternatingRowStyle-BackColor="#CCCCCC"  
            BackColor="White" BorderColor="#003366" BorderStyle="Inset" BorderWidth="2px"      
            EnablePersistedSelection="True"
            Font-Bold="False" Font-Names="Arial" Font-Size="10pt" ForeColor="#003366"
            GridLines="Vertical" HeaderStyle-BackColor="#336699"
            HeaderStyle-BorderColor="#003366" HeaderStyle-BorderStyle="Inset"
            HeaderStyle-BorderWidth="2" HeaderStyle-ForeColor="#FFFFCC"
            HeaderStyle-Height="20" HeaderStyle-HorizontalAlign="Center"
            HeaderStyle-VerticalAlign="Middle" HeaderStyle-Wrap="False"
            HorizontalAlign="Center" RowStyle-BackColor="White"
            RowStyle-ForeColor="#003366" RowStyle-HorizontalAlign="Center"
            RowStyle-VerticalAlign="Middle"
            SelectedRowStyle-ForeColor="#003366" ViewStateMode="Enabled" Width="90%"
            DataKeyNames="RecordID" AutoGenerateColumns="False"
            DataSourceID="ScheduleDataSource" Height="100%"  
            Showfooter="False" ShowHeaderWhenEmpty="True" style="margin-top: 0px"
            EmptyDataText="No Data Available" OnRowCommand="Layer1GridView_RowCommand"
        …
0
Free Tool: IP Lookup
LVL 10
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have a very large project with a very tight deadline especially because of billable time. My client is wanting some payroll features to be added to the application (VB.NET/Web Forms). All the hours etc. are based on getting information from a view named vClaimLine. There are a few items on this list: An employee has a pay rate and event has a pay rate. An employee can have a pay override for an event. Meaning if an employee has an override in the EmpPlusEventOverride table then, this rate trumps their pay rate. So my question is am I able to add a column to the view using an additional join without screwing up anything? I know that seems like a loaded question but in theory anyway... This way in my code behind for a payroll report I could utilize that column to see if there is a value in it. If their is, then their pay will be set to either that value or that value times their hours.

I created three new tables, one to hold their base pay and one to hold an event rate and one to hold a combined set rate for the Employee Plus Event.
0
I have this code and I need a css class to place a  red asterisk in front of label. For example *Field Rep.
The  asterisk should be bold

                  <div class="medium-3 column float left">
                        <label>
                            Field Rep
                        
                        
                        <asp:DropDownList ID="ddlFieldRep" runat="server">
                            <asp:ListItem Text="Select Field Rep" Value="0" Selected="True" />
                            <asp:ListItem Text="xxxx" Value="1" />
                            <asp:ListItem Text="llll" Value="2" />
                            <asp:ListItem Text="mmmm" Value="3" />
                        </asp:DropDownList>
                        
                        </label>

                    </div>

Open in new window

0
in my aspx, page I have a div, which I use to write html data being generated dynamically on the server side.

How can i open this html data in the div, in a new window/tab on a buttonclick.
0
Hello Experts

I am getting a json response from a URL which I am trying parse it and capture code to store in the DB

Its returning the string ok but I am unable to remove the quoted strings to save the code in the DB
 

 Dim jResults As Object = JObject.Parse(Json)
        Dim jsonResulttodict = JsonConvert.DeserializeObject(Of Dictionary(Of String, Object))(Json)
        Dim firstItem = jsonResulttodict.Item("error")
        Dim seconditem = jsonResulttodict.Item("success")
        Dim thirditem = jsonResulttodict.Item("codes")

example string:

'{"error":"","success":"1 code generated successfully","codes":["QTESTA2HLT"]}


I am getting the code as [{  "QTESTA2HLT"  }]

Al I want is to read as QTESTA2HLT

please advise

thanks
0
I would like to do mobile app development using Xamarin connecting to an ASP.NET web service. Most likely the app would require an internet connection, not allowing local storage.

What do people typically do? Where do they host their web service portion? What database do they use?

I typically work with asp.net and sql server database, but don't know if people are using something different. And if I were to allow some local storage, what do they use for that?

thanks!
0
I am looking for hosting server recommendations.

Our project will involve:

ASP.NET framework
SQL Server database
Xamarin mobile app

Load Balancer
Firewall

Recommendations?

Thanks!
0
I have a CustomersController and MeetingsController. I want a link at the bottom that will redirect to the "Create" view based on the Id field of the Meeting Model. The way I have it written now, it redirects to the Create view in the MeetingsController, but does not save to the Id of the Customer.

(Note: I realize there is a lot of superfluous code. This is a work in progress and much of the code was created by default with the entity framework scaffolding.)

Here is the Customer Details view code. The Html.ActionLink is at the bottom of the page. That is where I want to redirect to the Create Meeting page but I want that meeting to be attached to the customer that is in the details view. I can post screenshots of the webpages if the community thinks that would be helpful.

Customer "Details" view:
@model WoodTrustCRM.Models.Customer

@{
    ViewBag.Title = "Details";
}

<h2>Customer Details</h2>

<div>
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.SystemOfRecordId)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.SystemOfRecordId)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Relationship)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Relationship)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Tin)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Tin)
        </dd>

        <dt>
     

Open in new window

0
Dear,
I want to have the effect to disable further update (like to show gray background color), to whole page, when it's being idle for a while, by these

        .overlay {
            background: #e9e9e9;
            display: none;
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            opacity: 0.5;
        }
$(function () {
    // 1000ms=1s, here test use 10s, you could modify. 
    var time = 5000;
    var set = setInterval(function () {
        $(".overlay").show();
        $("#dialog").dialog();
    }, time);
});
    <div class="overlay">
        <div id="loading-img">
        </div>
    </div>

Open in new window

but I cannot get what I want, below
http://my-friend.co/RegRec2?id=18&user_abbr=mc2&readonly=n

what to adjust?
0
I have a asp.net (VB) web page where I'm uploading audio files to a folder in my web app, so for example my audio file would reside in '\Files\Music\myfile.mp3'.

I'm trying to use the <audio> tag to play the file on the same web page, when I do this on my dev machine everything is fine, but when I publish to production server the path is incorrect because the application is running under a root app, so when I try to load the file, the full 'Windows' path is prefixed so it now looks like: 'F:\Intranet\MyApp\Files\Music\myfile.mp3'

I've tried using server.mapPath and httpContext but neither is working for me.

How can I correctly reference the folder on the production server?

Thanks
0
New benefit for Premium Members - Upgrade now!
LVL 10
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

I have a grid view in which I am using emptydatatemplate.  I am trying to use gridview.rowcommand to get data from textboxes in the empty data row.  The code behind (vb.net) gives me nothing when using FindControl to get the text from the text boxes in the gridview control.  Can anyone help PLEASE?  Below is my code:

<EmptyDataTemplate>
                <%--<asp:Table ID="EmptyDataTbl" runat="server" Visible="true">--%>
                    <asp:TableRow ID="TableRow6" runat="server" Width="100%">
                        <asp:TableCell ID="TableCell1" runat="server" Width="100%" ColumnSpan="16" HorizontalAlign="Left">
                            <asp:Label runat="server" ID="lblNoData" Text="No Data Available">
                            </asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow runat="server" Width="100%" BackColor="#FFB0C4DE" Height="28" ID="AddPtDtlTblRw">
                        <asp:TableCell ID="EmptyNameCell" runat="server" HorizontalAlign="Center" CssClass="VerticalGridlines" Width="5%">
                            <asp:LinkButton ID="EmptyNameBtn" runat="server" Text="Insert Detail" Font-Underline="True"
                                BorderStyle="None" BackColor="Transparent" CausesValidation="False" ForeColor="#003366"
                                CommandName="EmptyInsert" />
                        </asp:TableCell>
                        <asp:TableCell …
0
I have a SQL database using various models including Customer, Meeting, and Attachment. I have controllers set up for each one of those models. Everything is working great in the navigation properties and links.

I am working off a database that was created before my time. It is used by a custom application that I am replacing with an ASP.NET MVC website. The Attachment table has the columns: Id, Path, Name, Meeting. The path is a location to a share on our network. Rather than listing the path on the webpage, I would like the name of the Attachment in the Meetings/Details view to hyperlink to the location on the network share. I am perplexed on how to set this up.

I would also like the Meetings view to have a link to upload an attachment.

I have attached a screenshot of the model diagram. Model
This is what I have for my CustomersController:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using WoodTrustCRM.Models;

namespace WoodTrustCRM.Controllers
{
    public class CustomersController : Controller
    {
        private WoodTrustCRMEntities db = new WoodTrustCRMEntities();

        // GET: Home - this is a view I created
        public ActionResult Home()
        {
            return View();
        }

        ////default GET: Customers
        //public ActionResult Index()
        //{
        //    return 

Open in new window

0
Hi Experts,

While exiting any page I want a message about unsaved work. So I am using the following code. It is showing me the message when there is any change in the form. But when I click "Leave this page" it does not leave the page it stays in the same page. Also When I click "Stay on this page" it gives me a java script error. Please suggest.

Thanks in advance.


  <script src="js/jquery.min.js"></script>
    <script>
        var dirtyScreen = false;
        $(document).ready(function () {
            $('input:not(:button,:submit),textbox,textarea,select').change(function () {
               dirtyScreen = true;
            });
           
        });
        var unloadEvent = function (e) {
            if (dirtyScreen) {
                var confirmationMessage = "Warning: Leaving this page will result in any unsaved data being lost. Are you sure you wish to continue?";
                (e || window.event).returnValue = confirmationMessage; //Gecko + IE
                return confirmationMessage; //Webkit, Safari, Chrome etc.
            };
        }
       
       window.addEventListener("beforeunload", unloadEvent);
</script>
0
I'm trying to add databinder into the hyperlink and getting this error

     <asp:HyperLink ID="hlinkFile" runat="server" NavigateUrl= "~/StudentDB/" + '<%#DataBinder.Eval(Container.DataItem, "FILE_LOCATION")%>'>">Open/Save</asp:HyperLink>

Open in new window

0
Does anyone know how to use iframes with authorize.net. I have a website that has an iframe for payments. The problem is that when i press countinue it stays in the iframe. i want the iframe to close and but in the main web browser tab. i am using asp.net with c#
0
Hello everyone, I developed .rdlc report. I want to print all pages of my report on single page without page break between multiple pages. How can i do that? Please Help me.
Thanks in advance.
0
we want to see anyone has been developing web form /c# with edmunds api. They do not have .net/c# sample.
Assume we have <asp:net dropdown> and I just need to bind their car maker, model, and year.

c#, asp.net
0
i have a asp.net mvc application.

I'm using the Employees table of the SQL Server Northwind database

My table looks like this:

table
Right now my dropdownlist displays  the EmployeeID

My razor code on my view looks like this:

@Html.DropDownListFor(model => model.EmployeeID, "Please Select an Employee: ", new { @class = "employeeclass1", @id = "EmployeeDDL" })


How do i set the default value on page load for my DDL to be 0?
How do I add a "ALL" text to my DDL so if someone selects that then the selected value for that is -2.

So then the only options my DDL would have are:
"Please Select an Employee:"  and the default selected value for this would be 0
"All" and the selected value for this would be -2
The other choices they would have are EmployeeID 1 through 9 which I already have and come from my model.
0
Dear,
Is there a way to save/store (within one button event) relevant latitude or longitude of the relevant position, already to the map below?

http://my-friend.co/RegRec2?id=18&user_abbr=mc2&readonly=n
0
What does it mean to be "Always On"?
LVL 4
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Hello Experts,
In a Windows Service program, I am trying to delete a file.  It works fine in my machine.  For example if the file is found, my program  deletes it and if the file not found, I get exception.  Same program when copied to production, neither the file gets deleted, not do I get any exception.  I am sure it goes to delete portion of the method.  Because I tested it with log4net.  FYI, in development I am using Windows 7 Pro and in Production Windows Server 2008 R2.  Any idea?  Below is my code.  Please help.

Thank you in advance.


public void DeletePMTFile()
        {
            string fullName = System.Configuration.ConfigurationManager.AppSettings["FULL_NAME"];
            string filePath = System.Configuration.ConfigurationManager.AppSettings["FILE_PATH"];
            var reader = new StreamReader(fullName);
            reader.Close();

            FileInfo fileName = new FileInfo(fullName);
            if (File.Exists(fullName))
            {
                try
                {
                    Array.ForEach(Directory.GetFiles(filePath), File.Delete);
                }
                catch (System.IO.IOException e)
                {
                    log.Error("DeletePMTFile: Error while deleting the file" + e.Message);
                    return;
                }
            }
            else
            {
                log.Warn("DeletePMTFile: " + filePath.Trim() + " not found");
            }
        }

Open in new window

0
I am using an iframe to display the form test.authorize.ent/payment/payment. when i press the contunite button on the authorize.net page it should close the iframe and take you to the final check out page. it opens in the iframe. Does anyone have an idea how to do this. I am also posting this to the authorize.net forum.

Below s the code i am using to call the iframe

 <div id="myForm" style="display:none">
    <div id="inline_content">
        <script src="Scripts/colorbox/jquery.colorbox.js"></script>
           <script type="text/javascript">
        $(".inline").colorbox({
            inline: true,
            opacity: 0.5, // overlay a bit less dark
            innerWidth: 640,
            innerHeight: 390,
            onComplete: function () { document.OutputForm.submit() }
        });

       
    </script>
         
        <form name="OutputForm" method="post" action="https://test.authorize.net/payment/payment" target="payframe" id="LinkTo" class="ShowForm">
      <input type="hidden" id="InToken" name="Token" value="" />
       </form>
        <iframe id="payframe" name="payframe"></iframe>
        </div>
        </div>
0
I am working with paypal payment. I want to implement payment condition below:-

Block payment amount on card at the time of reservation. If card cannot be blocked reject the event and add "Payment Declined" to the end of the description. Take payment at 12:01 am the day of the event.

For recurring events...
Block payment for first event at time of reservation. Take payment 12:01 am the day of the event.
For next event in the recurrence series, Block payment after the previous payment is taken and take payment at 12:01 am the day of the event. Continue this cycle until all reservations are complete.
 If card cannot be blocked reject the event and add "Payment Declined" to the end of the description but continue with the series of events.

Please know me how to implement.
0
I had this question after viewing Error 1053: The service did not respond to the start or control request in a timely fashion..

Hello,
I have exact the same issue as above.  I installed the Windows Service, when tried to Start the Service inside the Services window I received the error message below.  I looked at the above link, but it did not help me.  Any idea why I am getting this?  Please help.  Thank you in advance.

Error 1053: The service did not respond to the start or control request in a timely fashion.

Thank you!
0
I am trying to redirect a URL from http://www.rudythecarguy.com/ApplyNow.com to http://www.rudythecarguy.com/ApplyNow. I added the rewrite section below to the system.webserver section of the web.config, but it doesn't work. Is there a kind soul out there who can shed some light on this darkness?
Thank you.
 <rewrite>
      <rules>
        <rule name="RudyRedirect" stopProcessing="true">
          <match url="www.rudythecarguy.com/ApplyNow.com" />
          <action type="Redirect" url="www.rudythecarguy.com/ApplyNow" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
0
I have a  asp.net site which contains a Create User Wizard.  Furthermore there is a Label on the outside of the Create  User Wizard.   I want the text  from the   asp:Label Id="txtCategory"    to  appear in the  asp:label "txtCategory1" in the Content Template of  Create User Wizard..  
Please help me with the best manner to have this happen at Page Load.

Thanks


    <asp:Label ID="txtCategory" runat="server"></asp:Label>
                       
<asp:CreateUserWizard ID="CreateUserWizard2" runat="server">
                                 <WizardSteps>
                                     <asp:CreateUserWizardStep ID="CreateUserWizardStep2" runat="server">
                                         <ContentTemplate>
                                             <table>
                                                 <tr>
                                                     <td align="center" colspan="2"> <asp:Label ID="txtCategory1" runat="server"></asp:Label></td>
                                                 </tr>
                                                 <tr>
                                                     <td align="right">
                                                         <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
                                                     </td>
                                                     <td>
                                     …
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