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

SSRS Problem

$
0
0
MY ssrs report can not be accessed from a specific mobile operator (Grameenphone Bangladesh Ltd).Any solution pls???

How to capture session timeout when session manage in sql server

$
0
0
we are managing in sql server. I came to know that when we manage session in sql server then session end event never fire..,.is it true? Just guide me how to capture session timeout when we manage session in sql server. Thanks
tbhattacharjee

MVC - Service Layer Question

$
0
0
I was reading some articles about how to implement a service layer in MVC applications yesterday. One thought that came to mind was: what about data annotations used for model state validation? When you implement a service layer, do you get rid of those data annotations (like [Required] or [MaxLength]) for the model classes? This[^] is the article I was reading.
 
MVC development is mostly new to me, aside from the fact that I have a fundamental knowledge of the core concepts. I switched employers recently and our work here is done primarily in MVC, which I'm happy about because I've been wanting to get into it for a while now. My two coworkers are more knowledgeable than I am, for sure, but they're open to new ideas and new techniques that may help improve the applications. I figured a service layer would be beneficial not only to remove business/validation logic from controllers, but also because we're starting to write unit tests.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.

How to get an answer to your question

$
0
0
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

connectivity

$
0
0
I m preparing a project on airline reservation system
so i am having a problem in preparing bacend in mongodb.
so i need connectivity code of .net and mongodb.

From active directory Lookup finding AD Attributes (ie Account Locked)

$
0
0
How can I get active directory attributes such account locked or user not in active directory?

Reducing form size

$
0
0
Hello
 
I have a couple of aspx forms in my VB.NET project. Eventually, these forms will be used on a Classic ASP site which has already been created. The user will click on a link on a Classic ASP page and one of these ASP.NET forms will appear in a smaller window as there is no need for a log-in form to occupy the entire screen.
 
Therefore, I need to reduce the size of the form that I have - at the moment each form fills the whole screen - and I wonder what is the best way of reducing the size of the form?
 
Thanks!

web form using 2 gridview controls

$
0
0
In a vb.net 2010 web form application. I need to allow the help desk to be able to query up to 3 different tables when the need arises. This a support web page that supports a particular application that already exists.
 
The web page gives the help desk people directions for updating active directories and searching 2 tables.
 
My questions are about the 2 tables that need to be searched which includes:
 
1. If I place the access to all 2 tables on the same webpage in 2 separate gridview controls. is there a way for the webpage to show up all 2 gridview controls containing no data The user would have to complete searches to obtain the data. If so. can you show me code. point to a reference and/or tell me how to accomplish this goal?
 
2. Would you place the gridview controls on the same web page or different web page? Would you tell me where you would place the 2 gridview controls and why you decided on your recommendation?

Asp.net Ajax Autocomplete Return value to Search another

$
0
0
Hi friends,
I am using ajaxtoolkit (autocomplete for textbox) in asp.net, I have two textbox1 and textbox2. Based on textbox1 return value
I want to get value of textbox 2. please help some send me sample code or example in vb.net
thank you.
regards,
asad

How to verify email address using mx record?

$
0
0
I am writing to seek help, in regards to figuring out, how can I verify my email address using mx record. I am currently new into using MX records and so far, I have method which returns a mx record for specific domain (as shown below):
publicstaticstring mailMX()
    {
        string domainName = "#######.com";
        string mail = "";
 
        var response = DnsClient.Default.Resolve(domainName , RecordType.Mx);
        var records = response.AnswerRecords.OfType<MxRecord>();
        foreach (var record in records)
        {
           return (record.ExchangeDomainName).ToString();
        }
 
        return mail = records.ToString();
 
    }
My desire goal is to create a method, which can verify the email address "info@reply.####.com" has a valid mx record and return the email address. I am slightly struggling in this area, as I am not to sure how to structure this task.
 
Any hints would be most appreciated. Thank you

Deploy and run an ASP.NET application on WebLogic server

$
0
0
Hello all,
I'm a .net developer.
I have a project that I might get into.
The thing is, the servers are WebLogic.
I don't know a lot on this subject so I wanted to know if I can deploy my asp.NET application on that server (or what I have to dofor that)
 
Thanks for any help

Javascript logic causes the page to be stuck

$
0
0
Hi,
 
I have a pretty long and complex logic that needs to be run when the page loads.
The logic can't be changed.
What happens is that while the logic is executed, the page is of course stuck.
It involves drawing on the canvas element.
 
What options do I to work around this issue?

Regarding PDF Converted file

$
0
0
i have a project where the client has to place a purchase order, when the client save the purchase order it moves to a aspx web page there the purchase order is displaced as image file, with two button one to generate PDF and the next To Send EMAIL
 
i can generate a pdf when pdf button is clicked and it get downloaded when opening the pdf file its someother pdf file.i mean the generated pdf is not getting download insist of that another purchased order pdf details is seen but with current file name. i dont know what i did work in my coding, my coding is
 
Inherits System.Web.UI.Page
Private obj As New SqlHelper
Private _i As Integer = 1
Private att As String
Private PONO1 As Integer
Private pat As String
Private Att_ As String
 
'Private MailPoId As String
'Private objApp As Outlook.Application = Nothing
'Private objMail As Outlook.MailItem = Nothing
'Private Declare Function ShellExecute Lib _
' "shell32.dll" Alias "ShellExecuteA" _
' (ByVal hwnd As Long, _
' ByVal lpOperation As String, _
' ByVal lpFile As String, _
' ByVal lpParameters As String, _
' ByVal lpDirectory As String, _
' ByVal nShowCmd As Long) As Long
 
'Private Const SW_SHOW As Integer = 1
Protected Sub btnPdf_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPdf.Click
Dim warnings As Warning() = Nothing
Dim streamids As String() = Nothing
Dim mimeType As [String] = Nothing
Dim encoding As [String] = Nothing
Dim extension As [String] = Nothing
Dim bytes As [Byte]() = Nothing
Dim Folder As String
 
bytes = ReportViewer1.LocalReport.Render("PDF", "", mimeType, encoding, extension, streamids, warnings)
Dim str As String = Session("POrderNO")
'Folder = ' & DateTime.Now.ToString("dd-MM-yyyy")
'If Folder = vbNullString Then
' lblPdf.Text = "Please set the Pdf path"
' Exit Sub
'End If
 

 

Folder = Server.MapPath("~\PDFDownload\PO")
Dim di As DirectoryInfo = New DirectoryInfo(Folder)
Dim path As String
Dim fs As FileStream
Dim data As Byte()
If di.Exists Then
If Not File.Exists(Folder & "\" & str & ".pdf") Then
path = Folder & "\" & str & ".pdf"
Session("MailId") = path
fs = New FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)
data = New Byte(fs.Length - 1) {}
fs.Write(bytes, 0, bytes.Length)
fs.Close()
End If
Else
di.Create()
If Not File.Exists(Folder & "\" & str & ".pdf") Then
path = Folder & "\" & str & ".pdf"
Session("MailId") = path
fs = New FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)
data = New Byte(fs.Length - 1) {}
fs.Write(bytes, 0, bytes.Length)
fs.Close()
di.Refresh()
End If
End If
'
'Session("MailId") = str & ".pdf"
'Dim paths As String = Server.MapPath("~/PDFD/Uploads/")
Dim fName As String = Server.MapPath("~\PDFDownload\PO\" & str & ".pdf")
Dim fi As New FileInfo(fName)
Dim sz As Long = fi.Length
 
Response.ClearContent()
Response.ContentType = "Application/pdf"
Response.AddHeader("Content-Disposition", String.Format("attachment; filename = {0}", System.IO.Path.GetFileName(fName)))
Response.AddHeader("Content-Length", sz.ToString("F0"))
Response.TransmitFile(Server.MapPath("~\PDFDownload\PO\" & str & ".pdf"))
Response.End()
 

 
End Sub

How do I POST back a specific header

$
0
0
AM trying to integrate an online payment system, where the secure payment gateway will send a notification to a specified URL on my site - I have given a generic handler (.ashx) address. I can read the data they send (it's a simple POST), but they require that I send back:
a notification with a response of: "HTTP/1.1 200 OK".
I am not sure what they want... Is a simple
context.Response.ContentType = "text/plain"
context.Response.Write("HTTP/1.1 200 OK")
enough? Perhaps necessarily preceded with
context.Response.StatusCode = 200
?
Or is something more sophisticated required, along the lines of
 
Dim req As System.Net.HttpWebRequest = System.Net.WebRequest.Create("https://secure-gateway-url")
    req.Method = "POST"
    req.ContentType = "application/x-www-form-urlencoded"
    req.Accept = "HTTP/1.1 200 OK"  ?????
    req.Headers .Add (   ?????
    Dim param AsByte() = context.Request.BinaryRead(HttpContext.Current.Request.ContentLength)
    Dim strRequest AsString = Encoding.ASCII.GetString(param)
    req.ContentLength = strRequest.Length
    Dim streamOut As System.IO.StreamWriter = New System.IO.StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII)
    streamOut.Write(strRequest)
    streamOut.Close()
with what needed at the lines flagged ????
 
I’d be very grateful for any advice... thanks

Beginner

$
0
0
i am beginner in asp.net so please recommend a book and articles please

delaying data load for a repeater on web form

$
0
0
Hi All, i'm after a bit of advice on the homepage of my app there is one particular section (Repeater) that queries the DB to provide a high level overview of the latest version of an application. Loading the data into this repeater is having an impact on the load time of the homepage so my thought on this is to is to add a checkbox to the page and on the initial page load do not populate the repeater but if the user checks the checkbox to display the data then go an query the DB to populate the repeater. Aside from only loading this data on request what other way could I control the populating of this repeater so that is not impacting performance?

I am stuck on this error now for two days - value cannot be null: Parameter name: reportParameters

$
0
0
Hopefully, I am posting on correct forum.
 
I have a report with a parameter called loc.
 
The intended purpose of the report is to allow users to select a location from the dropdownlist and then records associated with that location are displayed to the users.
 
The dropdownlist is getting populated with values just fine.
 
However, when I select a location from the dropdownlist, I get an error that says:
 
Value cannot be null. Parameter name: reportParameters
 
Everything works fine when I pass a value as textbox but not as dropdown.
 
Any ideas what I am doing wrong?
 
Below are relevant code.
 
'---Dropdownlist control
 <asp:Panel runat="server" ID="pnlLoc" Font-Names="Calibri" BorderStyle="Solid" BorderWidth="1" Style="margin: 0 auto; width:300px;">
             <table>
                 <tr>
                     <td>
                         <asp:Label runat="server" ID="lblLoc" Text="Location: " />
                     </td>
                     <td>
                         <asp:DropDownList runat="server" ID="ddLoc" DataSourceID="dslocator6" AutoPostBack="True">
 
                         </asp:DropDownList>
                     </td>
                 </tr>
             </table>
          </asp:Panel
 
 --Report viewer control
   <rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="true" SizeToReportContent="true" Font-Names="Arial" 
        Height="675px" Width="750px">
        <LocalReport EnableExternalImages="true" ReportPath=""> 
        </LocalReport> 
    </rsweb:ReportViewer></center>
     <asp:ObjectDataSource ID="LOC" runat="server" SelectMethod="GetData" TypeName="ManageReportsTableAdapters.searchBylocationsTableAdapter">
      <SelectParameters>
        <asp:ControlParameter ControlID="ddLoc" Name="Location" DefaultValue=" " />
      </SelectParameters>
     </asp:ObjectDataSource> 
 
           --This code populates the ddLoc dropdownlist
               Protected Sub btnLoc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLoc.Click
               ReportViewer1.LocalReport.ReportPath = ""
               pnlLoc.Visible = True
               which.Value = "P"
               dslocator6.SelectCommand = "SELECT location FROM Locations ORDER BY [location]"
               ddLoc.DataTextField = "location"
               ddLoc.DataValueField = "location"
              End Sub
 
          Sub Run_Report(ByVal sel As String)
            ReportViewer1.Reset()
            ReportViewer1.LocalReport.DataSources.Clear()
            Dim params(0) As ReportParameter
 
            ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("locs", LOC.ID))
            ReportViewer1.LocalReport.ReportPath = "locations.rdlc"
            ReportViewer1.LocalReport.Refresh()
            params(0) = New ReportParameter("loc", sel, False)
            ReportViewer1.LocalReport.SetParameters(params) '<-- error points to this line
            
           End Sub
 
I have been stuck on this for two days. Your assistance is greatly appreciated.

why onblur Event Dosent Work For Div Element ???????????

$
0
0
Hello
I have a Project that Use Very Div Element And Onblur Event In its.
Because Of Security Reason We Switch From a version of JQuery To another .
 
But We Face With This Problem :
onblur Event dont Fire In Div Element
But it Fire in input elements Like Textbox!!!!!
and also onfocusout Event Fire in dive
but i dont want use this.
<divonblur="alert('dosent work this Event!!!!!')">
any help To solve this Problem can be useful
 
thanks in advance

How to find in useful/unnecessary files from website folder ???

$
0
0
Hi,
I am designing a website. The designing is almost complete.
But I am noticing that there is many images and file is unlinked and in useful.
It is unnecessary present in the project. I would like to remove/delete it. But
it almost impossible to detect these types of files manually, impossible. So is there any way
to find these files ? Please help me.

How can i Post Radio Button List with Dynamic names to controller

$
0
0
Hi everyone.
I am well and truly stuck.
I have created a huge list of radio buttons on my razor view. Each row is a different set of radio buttons and I have given them each dynamic names.
I am new to MVC and i did not know how i can pass this radio button list to controller

this is my editor template

@model StudentManagement1.TeacherCourseStudent
@{
    ViewBag.Title = "Attendance";
}
 

<tr><td>
       @Model.Student_Id
    </td> 
    <td>
        @Model.Student.Name
    </td> 
    <td>
        @Model.Student.Sur_Name
    </td> 
    <td>
       @Model.Student.Semester.Semester_Name
    </td> 
    <td>
    @Html.RadioButton(@Model.Student_Id.ToString(), "present", true)
    </td> 
    <td>
    @Html.RadioButton(@Model.Student_Id.ToString(), "absent")
    </td> 
    <td>
    @Html.RadioButton(@Model.Student_Id.ToString(), "leave")
    </td> 
 
and this is my view
@model IEnumerable<StudentManagement1.TeacherCourseStudent>
@{
    ViewBag.Title = "MarkAttendance";
    Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}
 
@using (Html.BeginForm("MarkAttendance", "Attendance", FormMethod.Post))
{
   
 
<table><tr><th>
           Student Id
        </th><th>
            Name
        </th><th>
           Sur Name
        </th><th>
           Semester
        </th><th>
            Present
        </th><th>
            Absent
        </th><th>
            Leave
        </th> 
        
</tbody>
@Html.EditorForModel()
</table><br/><br/><inputtype="submit"value="Save attendance"/>
}
 
 
here my controller to which i want to pass values
[HttpPost]
        public ActionResult MarkAttendance(IEnumerable<string> Student_Id)
        {
            return view();
}
MVC
Viewing all 3938 articles
Browse latest View live