Page Not Returning Any Results / No Msgbox When Clicked Extra
Aug 8, 2012I am trying to get my first asp.net app running.If I click a button it just refreshes the page returning nothing.
View 8 RepliesI am trying to get my first asp.net app running.If I click a button it just refreshes the page returning nothing.
View 8 RepliesI try to implement simple SOAP server on ASP.NET and simple client on php and get the problem with response and request format. My server is very simple, take one string and return another:
[WebMethod]
public string HelloWorld(string Additional) {
return "Hello " + Additional;
}
I expect, that php client is such simple:
$client = new SoapClient('path');
print_r($client->HelloWorld('homm'));
But actually, function take only objects and return object with single member — HelloWorldResult:
$client = new SoapClient('path');
print_r($client->HelloWorld(array('Additional' => 'homm')));
stdClass Object
(
[HelloWorldResult] => Hello homm
)
What part I need to change, server (ASP.NET) or client(php) to work with results and parameters indirect?
The SQL is below - each result is coming up 3 times rather than just once.
SELECT Consignments.LegacyID, TripDate, CollectionName, DeliveryName, Pallets, Weight, BaseRate, Consignments.FuelSurcharge, AdditionalCharges, BaseRate * Quantity AS 'InvoiceValue', Consignments.Customer, InvoiceNumber,
CASE
WHEN child.LegacyID = Consignments.Customer THEN child.LegacyID
WHEN parent.LegacyID = Consignments.Customer THEN parent.LegacyID
ELSE this.LegacyID
END AS 'InvoiceAcc'
FROM SageAccount this
LEFT JOIN SageAccount parent on parent.LegacyID = this.InvoiceAccount
LEFT JOIN SageAccount child on this.LegacyID = child.InvoiceAccount
JOIN Consignments on (Consignments.Customer = this.LegacyID AND this.Customer = 'True')
OR (Consignments.Customer = parent.LegacyID AND parent.Customer = 'True')
OR (Consignments.Customer = child.LegacyID AND child.Customer = 'True')
WHERE (this.LegacyID = @Customer) AND (TripDate BETWEEN @fromdate AND @todate) AND (InvoiceNumber IS NOT NULL)
The SQL was given to me for another similar query, but this time I have modified it to try to use it for the query I'm doing now, so I'm assuming that I'm doing something stupid.
I have a query using LINQ-to-SQL. It queries an underlying database table Rooms. It uses Where conditions to narrow down the results, namely:
Gender.
Current Occupancy < Max Occupancy
Available Flag is Checked
I know this should return results but it keeps returning an empty set. Any ideas? Code is below
Dim selectedHalls = (From sh In dbHalls.Rooms _
Where sh.gender = Session("gender").ToString _
Where sh.max_occupancy > sh.current_occupancy _
Where sh.is_available = 1 _
Select sh.building_name).Distinct()
UPDATE: I've verified that the issue is with the statement where sh.is_available = 1, which doesn't make sense since this is a bit field.
I am hoping someone can point me in the right direction here. I am trying to create web service that will return ajaxified results. Specifically, I want to write a web service that will fetch email through a secure connection. However, rather then have the web service return every single email, I just want to fetch maybe 5 emails at a time. I've always used Ajax as a client helper technology and not sure how to go about implementing this on a server side, or if its even possible.
I am using ASP.NET/C#, by the way.
Edit: I solved my problem but if you have anything to add do. Note: I did not create the DB it was created by Wordpress hosted on GoDaddy with my site I have a MySql Database called "wordpress" (for clarity). I want to be able to grab the most recent post from my blog and show it on the landing page for my url.
So my thought is this: connect to the MySql DB, run a query to grab the most recent post, display the post.
I built a class to handle the connection and process the request:
public class DAL
{
private string connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=[server here]; PORT=[port]; DATABASE=wordpress;
USER=[user name here]; PASSWORD=[password here];";
private OdbcConnection blogConnection;
[Code]....
In my web form I have a search box. The user enters a string, and once the search button is clicked, I pass the value from my .js file to my .cs file and do some processing to get the results. Up to this point everything is fine, but now I dont know how to get my results back to my .js page. The serach results at this point are in a dataset, and also in an multidimensional array. I have a multi array because I need to pass back the code and description of the items found.
[Code]....
At this point I have used the passed string 'value' to get my required code/descriptions, but i'm not sure how/if I can get either the Dataset or multidimensional array back to my .js page
I have a procedure that is used on a search page.. im trying to provide a highlevel resultset which you can then click on a record to view all records associated with it.
My expectation is to return 5 columns.. the ID and Date is what i want to group on.. so that if there are 10 records for ID=5 and Date=10/25/2010 then in my results i would have 1 record. Once im done with the page, you can then click on that line in the gridview to view the 10 records for that id. Does that make sense?
I have the following query, but for the criteria i entered, im getting back 3 records instead of just 2 since there is a differnet reboot count, BUT i really still just need overall data. so it should be only 1 record and seen below is what is returned and what is expected..
[Code]....
Here are the 3 records..
Currently returned
id Event Date Mount Errors Reboot Count J1939
225 11/01/2010 0 11 0
225 11/01/2010 0 11 0
225 11/01/2010 0 12 0
Expected returned
id Event Date Mount Errors Reboot Count J1939
225 11/01/2010 0 34 0
I am trying to create a search page, this allows the admin to search through the entries in the database by certain criteria, such as province (like state but diff country)
Here is the code I have so far. The problem is that I am not getting any errors. But I am also not getting any results. The page just posts back and returns to the blank search page. The GridView does not display any results.
here is my code as it stands:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration
Partial Class administration_Search
Inherits System.Web.UI.Page
Protected Sub ProvinceButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ProvinceButton.Click
'get the search string from text box
Dim Search As String
Search = ("%" & ProvinceButton.Text & "%")
'if the string has value then continue with search
If Len(Trim(Search)) > 0 Then
Dim con As String = WebConfigurationManager.ConnectionStrings("fubar").ToString()
'build sql string
Dim s As String
s = ("SELECT id, surname, name FROM orders WHERE province like @strSearch")
'declar connection
Dim c As SqlConnection = New SqlConnection(con)
'add command
Dim x As New SqlCommand(s, c)
'add parameter
x.Parameters.AddWithValue("@strSearch", strSearch)
c.Open()
Dim r As SqlDataReader = x.ExecuteReader
GV.DataSource = r
GV.DataBind()
c.Close()
Else
Province.Text = ("Please enter search terms")
End If
End Sub
End Class
On the .aspx page I have a textbox (id: province) and a button (id:submit)
I'm having an issue with SSRS 2008 inside VS 2008, where I have a report that is connected to the database via a Data Source which is working correctly, but when I execute a query inside the query designer to test my data, it returns zero records.
The issue I'm having is that the EXACT same query inside SSMS returns the correct record. I'm really stumped as to why it all is connected, but not returning the record. I have another report in the solution that uses the same database, but that one actually works ok.
Gridview is not being populated now that i built my objectdatasource in the code behind.. why. If i build the source on the aspx page and configure it that way, it returns results.. but when i try to build it in the code behind it just displays my empty template for the gridview.
[Code]....
I have a page where users can search by company name, the data list is pulled from an Excel spreadsheet hosted on the site. I'm seeing some strange results returned, for example:
In the company field say there are the following entries:
Anns Company
Bernards Business
Company B
Dermots Domain
Property Company
If I search for "Com" I get the following returns (correct):
Anns Company
Company B
Property Company
If I search for "Der" I get my "Sorry there are no matching results" message (Incorrect)
If I search for "Ann" I get the following returns (Correct):
Anns Company
And if I search for "e" I get the following returns (Correct):
Bernards Business
Dermots Domain
Property Company
It seems random as to why it doesn't return some values, I've tried moving rows around to see if that's the problem but it makes no difference. My range is set correctly in the spreadsheet.
When I debug the VB code behind, when I search for something that works correctly e.g. "Com" in the above example, once enter the value and click search Visual Studio begins steping into the code and shows me the contents of the variables however when I search for something that's not working e.g. "Der" and click search it immediatly returns the "Sorry there are no matching results" message and the code behind does not get steped into.
I have this statement which is used to create my msgbox dynamically but it is not working unfortunately. see statement below this
.Button1.Attributes.Add("OnClick",
string.Format("javascript:return
confirm('Are you sure you want to make this change?');"
));
I'm beginning to see the end of my first pet web project here, but I have this msgbox that's giving me a bit of a headache, it's loading but not getting focused:
[Code]....
How to write data in MsgBox?Sorry, I do not know how to say this.I have label1 and button1.When I click button1, it displays the MsgBox for writing data.When I write data, it appears in label1, when I click Ok.
View 2 Repliesi m using asp.net Usercontrols How to show alert msgbox if user doesn't select atleast minimun 1 checkbox from asp.net checkboxes
if i have disabled some checkboxes on page load event then after user forgot to check checkboxes and click on button then still msgbox will popup "you haven't select checkboxes"
edit my this code ...to show msg box on button click event if i have disabled checkboxes and if user haven't select any of the checkbox
[Code]....
we are using swfupload for the sake of uploading process in our project but we need add some extra parameter and send them via swfupload to aps.net page
how can I do this? is it possible at all to passing extra parameters to a server-side page by using swfupload?
I am finding an issue with build release of asp.net project. The code files page attributes gets changed after build.
The code is <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest ="false" CodeFile="~/AssociateJob.aspx.cs" Inherits="XXXXXX.AssociateJob" %>
And build is: <%@ page language="C#" autoeventwireup="true" validaterequest="false" inherits=" XXXXXX.AssociateJob, XXXXXX_deploy" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>
After build, we expect only highlighted portion should be different, rest all should be the same. Three attributes (enableviewstatemac, enableEventValidation, viewStateEncryptionMode) are coming extra in the deployment. We use FinalBuilder to build the project, which uses MSBuild internally.
I am performing "semi"-custom paging for my dynamic LINQ query. However, if the number of results returned exactly fill the page, then I wind up with one extra page that's empty and I can't figure out why. i.e. if I have a page size of 15 and 14, 21, 101, etc. items then everything is fine. However, if I have 15, 30, 45, 60, etc. then I get one extra blank page and I've been unable to make it stop. Anyone have some ideas except to add a new record when I see we're sitting on a multiple of the page size?
I write out the paging control like this and it loops through one time too many if the last page is full...
[code]....
I have an HTML report, with each print page contained by a <div class="page">. The page class is defined as
width: 180mm;
height: 250mm;
page-break-after: always;
background-position: centre top;
background-image: url(Images/MainBanner.png);
background-repeat: no-repeat;
padding-top: 30mm
I have a following issue (it's only happening in Internet Explorer).
I add callback to a page in the old-fashioned way -> Page.ClientScript.RegisterClientScriptBlock(...)
The scenario is: 1) The default page is being loaded. On Page_OnLoad it assigns a NULL to some session key. Let's call it Control -> Session["Control"] = null;
2) User presses a button and gets redirected to a next page (let's call it NextPage.aspx) using javascript event -> window.location.assign(....) (also tried .href = ... - no help)
3) The NextPage.aspx assigns some value to Session["Control"] on Page_OnLoad
5) User clicks a button on the NextPage.aspx and a callback request is being sent to a server....
TA DA!!! The interesting part:
6) Along with the request to the NextPage.aspx another request is being sent to the default page.
7) The only response is being recieved by a client is a response from the NextPage.aspx BUT since the code on the default page is being executed it puts null to the Session["Control"] which screws all my following scenario. the default page doesn't recognize the request as a callback? so if(IsCallback) {} doesn't help....
I believe it's not a code issue since as I wrote above it works in development environment,but I have no clue what can 'cause it to fail in production and only in IE...
At least what to start to look at... and I have Helicon's ISAPI Rewrite installed on the production server. It doesn't seem to be the cause but who knows....
Correction
if I do not assign window.location and just add a link to the NextPage.aspx and click it manualy after callback ended it still sends extra request to the default page. if I click the link before I initialize callback it works fine without extra request.
I have an web application with crystal report. The report are printing fine. But the problem is
i have applied page margin setting as
Top Margin 0.25 in
Left Margin 0.02 in
Bottom Margin 0.17 in
Right Margin 0.42 in
all are fine without Bottom Margin. Bottom Margin will come with more space without considering 0.17 in. I think that it may be happened that the detail section i have a rectangle box object. Inside this box have data from data base. I want to print this box as 3 times in a page with three records. all are fine.I adjested maxium to fit the box in details section to dispaly three times in a page. But when i wil get the print out the three box will come with 3 times. But after the three rectangle box ,the footer of the page will take some extra space.
I don't want to print pagefooter,page header,report header, report footer at all. i am suppressed these things.
I want to know why it is came with some more space on the footer.?
How to solve the issue?
And tell me the C#.Net code for pageHeader Suppress,report header suppress,report footer suppress,page footer
We have a web project that contain its business methods in a class library project called "Bll.dll"
some methods of Bll.dll return List<> ... from a source - that i don't remember now - told that returning Collection<> is better than returning List<> Is it a valid ? Note that i don't make any process on values returned from BLL methods .. just view it in a web page
i have a gridview of name "PRODUCTS"
now i want to add a link button , on cllicking that link button a new page in other tab will open with that Product Name and ID , then i want to read that product name and id and fetch records according to it ...
e.g:
PRODUCTS PAGE :
GRIDVIEW :
ID | Name | Detail
1 | Apple | DETAIL
2 | Banana | DETAIL
now when a user click on DETAIL row in apple , in new tab a page called DETAIL will be open and it would show URL like this :
http://localhost/ABC/DETAIL.aspx/ASDESX9023
the reason behind ASDESX9023 is : i dont wanna show the actual project name and id here ...
then after recieving this URL ;
below in my data list which is residing in DETAIL Page , the records must get fetched according to this URL ..
I have a page that works great until now that they wanted to add a ModalPopup based on a field value. Before the addition of this modal popup, i had a button event that would do the inserting of the data, it caused the page to validate and as long as the page passed then it would insert and move on to the next page. Now i have a ModalPopup displaying IF a certain field is empty. If they answer Yes to the modalpopup question, it takes them back to the page and sets the focus on that field. Works fine, but if they select No then i need the page to validate and insert the record and move on.I have a customvalidator for the field i need to check. I then have my insert on the main button that causes the validation. The "Yes" and "No" buttons within the modalpopup have the following setup.
[Code]....
My Main submit button has the following:
[Code]....
If i select NO it just goes back to the page and doesnt move forward. If i select YES and enter something the page pops up the modal again and again because i've clicked in the field and keeps asking even though there is now a value in the field. But since there is a value, i can continue on to the next page.