C# :: Button Taking To Another Page

Nov 12, 2014

I decided to code my own GUI menu. getting to another page from a button click. I have added the event handler I think (click="Button_click") then in the event handler I have added this:

private void Button_Click(object sender, System.EventArgs e);
}
Response.Redirect("Login.xaml");
}

After researching it says either to use
Response.Redirect("Login.xaml");
OR
Server.Transfer("Login.xaml");
Neither of these work, underlining "Response" and "Server" as an error saying "A namespace cannot directly contain members such as fields or methods."

NOTE: MY MAIN GUI PAGE IS CALLED "mainpage.xaml" THE CODE ABOVE IS STORED IN THE "mainpage.xaml.cs" THIS MIGHT BE RIGHT OR WRONG BUT I'M NOT SURE SO I AM LEAVING SOME EXTRA INFO!

View 1 Replies


ADVERTISEMENT

C Sharp :: Cannot Access Server Page Custom Controls In Website Page

Jan 24, 2015

I m making calendar in server control page by taking composite control.I am also adding textbox in each cell of calendar. Now i want to access the value of each textbox of selected month and respected date in default.aspx page on button click event. Here the button is not a custom control but defined in default.aspx page..

Can't access textbox text and date or controls of server page in website(default.aspx) page.

View 2 Replies View Related

C Sharp :: Loop In A Button / Runs Endless When Pressing The Button And Not Only Once

Jun 10, 2014

I have an code that makes form window + button bet bigger when pressed each time, but it runs endless till out of screen,

code:
{
int S1 = 300;
int S2 = 0;

[Code]...

make it so it runs only each time i press the button?

View 2 Replies View Related

C++ :: Taking A Screenshot In OpenGL

Sep 14, 2013

I've read up on .bmp files on wikipedia and am currently attempting to make a function that can export a .bmp file of the screen of my programs. I've already begun work on it but it isn't working. The code I have so far is:

typedef char Byte;
typedef int Byte4;
typedef short Byte2;
struct BMP_Header {

[Code] ....

My problems are that when less then the required amount of bytes is needed to store a value in the file, the 00 bytes are skipped (Ex. The file will contain 42 instead of 42 00 00 00), and the Pixels are stored as nothing but 0D ( every value intended for storing pixel data is 0D ).

View 4 Replies View Related

C++ :: Increment In Variable Not Taking Place

Oct 27, 2013

I have created this code; it is a taxi management system. I've made a class 'List' which handle a linked list structure of the waiting taxis and waiting passengers. The class has a public int variable: waiting, which keeps track of the number of waiting taxis/passengers.

#include<iostream>
using namespace std;
class Queue{ //Class for indivdual taxis and passengers, which will be members of linked list.
public:
string id;
Queue *next;
Queue (){

[Code] .....

But when I run the code and type in a new taxi number, the code does not increment the number of taxis by one the linked list by one. I can't seem to find the problem.

BTW, in the 'int main', I've added "<< taxi_list.waiting" at the end of the line after the user inputs the new taxi registration number, so that I can see how many taxis are now on the list. This is what is being shown as zero, no matter what.

View 2 Replies View Related

C++ :: Taking Input File And Doing Calculation

Dec 13, 2014

I am trying to work on a C++ program to calculate the quadratic formula using input files and classes. I have written my class, but I am trying to find a way to take an input file with unknown number of lines of coefficients. How do I take each integer from each line and set that value as "a" and "b" and so forth, then start over on the next line?

This is what i have so far.

fstream inputfile;//users input quadratic coefficients file
ofstream outputfile;// outputs a file with solutions
int main(int argc, char *argv[])// argc is argument count, char *argv[] is array of array of characters for arguments {
string dataline;
getline(inputfile, dataline);

[code].....

View 1 Replies View Related

C++ :: Class Taking Integers Or Doubles

Nov 18, 2014

Ok so I have a class that takes integer fractions and I want it to be able to take doubles also depending on what the user inputs. How would I go about this? I was thinking templates ...

View 7 Replies View Related

C/C++ :: Taking True Bool And Having It Display Statement Instead Of 1 Or 0

Dec 4, 2014

I am again a bit confused with bool since we have not used them much. I understand it is suppose to return a true or false value that is represented by 0 and 1. so I have these two bool's

bool Triangle::isRight() {
if (pow(largestSide(), 2) == (pow(smallestSide(), 2) + (pow(middleSide(), 2)))) {
return true;
} else {
return false;

[Code] ....

and then I cout to display them

cout << "Is this a right triangle: " << t2.isRight() << endl;
cout << "is this a Triangle: " << t2.isTriangle() << endl;

and i get this
"Is this a right triangle: " 0
"Is this a triangle: " 1

Which i know is correct but I want to replace the 1 and 0 with my own string but the things iv tried tweaking with has not worked.

Also in the file attached has some requirements from my teacher but i was confused at the second last one, --- bool isEqual(Triangle &other) and it says return true if triangles are equal and false if triangles are not.

I dont know if this is just simply if one triangle equals another (however you determine that) or if its for the two bool's, isTriangle() and isRight() or what.

Attached image(s)

View 2 Replies View Related

C/C++ :: Taking In File Path Names From User

Jul 22, 2014

How can I take in a path name like "C:myfolderfile.txt" where the user enters exactly that? I've tried putting the arg into a string, then looping through the string to find the '\', but by that time it is too late as c++ considers the '' as a escape character.

Is this even possible? I've googled it and everyone just says to make the user input the path with double \ or with a /.

View 1 Replies View Related

Visual C++ :: Taking Decimal Input From The User

Feb 21, 2015

I want the input for the price in decimal format(15.00). If the input is in integer format then I want to convert it to decimal format.

The maximum price for a sale is 999.99 and minimum is 0.00.

I have tried so far:

Code:
#include<iostream>
using std::cout;
using std::cin;
void main(){
float eventPrice;

[Code] .....

A valid input will be:

1.8,
0.8,
0.00,
0,
9,
99

View 2 Replies View Related

C++ :: Coin Program Not Taking In Amount Of Cents In Input

Mar 1, 2013

I'm currently working on a program to take the user's input as DDDD.CC and then converting it to the least amount of coins using quarters, dimes, nickels, and pennies. I was told to not use any doubles or floats as they would produce errors. And supposed to the use the library function atoi() after I take the input user's amount as a string to convert it into an integer.

So far the string input has worked and it produced the right number of quarters but it leaves off the cents. For example, I put in 352.23 and it gives the right amount of quarters but leaves off the 23 cents.here's my code:

#include <iostream> // Allows the program to perform input and output
#include <stdlib.h> // Atoi
#include <string>
using namespace std ; // Enables a program to use all the names in any Standard C++ header
int main() // Start of program execution {
string line ;

[code]....

View 6 Replies View Related

C++ :: Taking Data From Files And Output Information To Another File

Apr 2, 2014

Whenever I run my program, It should be taking this string of information:

Shampoo 10 8.75 87.50
Pen 3 2.50 7.50
Headphones 5 20.99 104.95
MacAir 1 879.23 879.23

Raspberries 6 4.99 29.94
Oranges 5 2.79 13.95
Apples 3 3.85 11.55

From one file and outputting it to another, the finished product should look like:

Shampoo 10 8.75 87.50
Pen 3 2.50 7.50
Headphones 5 20.99 104.95
MacAir 1 879.23 879.23

cheapest item = Pen
most expensive item = MacAir
total cost = 1079.18
shopper = Mary Kay

Raspberries 6 4.99 29.94
Oranges 5 2.79 13.95
Apples 3 3.85 11.55

cheapest item = Oranges
most expensive item = Raspberries
total cost = 55.44
shopper = Winnie B. The Pooh

When I run my code however, it doesn't get past shampoo and will continue to add shampoo to the total cost infinitely. How can I change the code to produce the proper information?

CODE:
#include <iostream>
#include <fstream>
#include <iomanip>
#include <float.h>
#include <sstream>
#include <string>
using namespace std;
ifstream input_file;
ofstream output_file;

[Code] ....

View 1 Replies View Related

C++ :: Dispatch Message Taking Frames Away While Moving Window

Oct 29, 2014

lets start with the code:

while(run)
{
if (PeekMessage(&msg, win->win_handle,0,0,PM_REMOVE))
{

[Code]......

I have created a basic window and i discovered that while resizing or moving my windows, the myframe() don't get any calls at all.

Is there anyway possible that myframe gets at least someof the calls while those things are happening

View 1 Replies View Related

C/C++ :: Template Class Function Taking A Derived And Generic Object

Feb 23, 2014

I'm trying to write a function for receiving messages, so my classes can communicate with each other. The only issue I get is a compile error asking me to define the base parameter as one of the derived instances. I tried using a void* to fill the need, but then I lose the initial type, which I need to check for. How might I go about writing a generic object for this?

Here's my code:

template<class Object>
class State
{
public:

[Code].....

Should I just have all of the objects inherit in the order of Object >> GenericObject >> DerivedObject?

View 10 Replies View Related

C/C++ :: Error C2064 / Term Does Not Evaluate To A Function Taking 1 Arguments

Aug 7, 2014

i'm implementing a templated function callback.

I get this error:

"error C2064: term does not evaluate to a function taking 1 arguments"

I'm not sure why.

Here's the code for the template function in the timer class header:

template<class T>
void TimerEvent(DateAndTime DateTime, std::function<void(T)> Callback);

Now the class body:

template<class T>
void GameTimer::TimerEvent(DateAndTime DateTime, std::function<void(T)> Callback)
{
DateAndTime time;
time.Now(false);
if (time.Compare(DateTime) == 1)
Callback(T);
}

and calling the class in the Engine:

int test1(int a)
{
}
void Main()
{
gameTime.TimerEvent<int>(gh, test1(1));
}

View 6 Replies View Related

C/C++ :: Check Rational Or Irrational Numbers After Taking Square Root?

Aug 4, 2014

I tried to check the rational or irrational numbers after we take the square root. i dont get the formula. for eg. squareroot of 64 is 8 and it is rational. square root of 2 is irrational. how to check it in c++..

View 10 Replies View Related

C++ :: Quantlib / Error C2064 - Term Does Not Evaluate To A Function Taking 1 Arguments

Dec 8, 2014

The first call of my function works with empty vectors but fails when dimensions are introduced to the vectors.

When "uncommented, the commented out function call fails with the error above.

These links might be useful for those unfamiliar to QuantLib:

[URL]

QuantLib: GeneralLinearLeastSquares Class Reference

Code:
#include "stdafx.h"
#include "boost/multi_array.hpp"
#include <cassert>
#include <qlmathgenerallinearleastsquares.hpp>
#include <vector>
#include <list>
#include <iostream>
#include "boostlambdalambda.hpp"

[code]....

View 8 Replies View Related

C++ :: Debug Error When Taking A String And Casting It To Float With File Stream

May 9, 2014

Debug Error

ProjectsFinal ProjectGrItemDebugGrItem.exe

R6010 - abort() has been called

I was going over this with a friend and it seems as though getline() is not reading anything in and thus throwing the abort error. I'm not sure why this is because I've included the textfile, with the correct name of course, in both the regular file location and the debug folder. I ask for user input and the user then inputs the name of the file they want, I do some required things behind the scenes and display the results for them in a cmd window. I've included pastebin files for both my header and cpp files because it is far to large for one post I shall, however, post the full code in the comments.

Quick Code

The problem occurs on line 159. I'm assuming once this line is fixed, line 163 will have the same problem.

// Read regular price
getline(nameFile, input, '$');
vectorList[count].regPrice = stof(input.c_str());// Casts string to a float
// Read sale price
getline(nameFile, input, '#');
vectorList[count].salePrice = stof(input.c_str());

Pastebin Links : [URL] ....

View 2 Replies View Related

C# :: Get Value Of Integer From Another Page

Nov 7, 2014

DisplayImages.aspx.cs file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using mshtml;
using HtmlAgilityPack;

[Code]...

Now I'm getting the value of id i.e "DisplayImages.aspx?id=3" from DailyDarshan.aspx and want to display the images of each respective link according id.. when I click on "DisplayImages.aspx?id=4" link so it has to show the if(id == 4) images...but The problem is int id its not taking value itself.on DisplayImages.aspx.cs page I must have to define the id. for e.g. I wrote int id =3; on DisplayImages.aspx.cs file so it shows the images of id = 3 on each and every link.. Tell me what should I do to take value from another page or else how int id takes value by itself...

View 4 Replies View Related

C :: Aligning Struct To A Page

Nov 22, 2014

I am a bit unsure about what this piece of code aligning a struct to a page is trying to achieve.

Code:
#define PAGESIZE 1 << 12

typedef struct __attribute__((aligned(PAGESIZE))) x86_pagetable {
x86_pageentry_t entry[PAGETABLE_NENTRIES];
} x86_pagetable; It is an piece of code from an educational operating system WeenyOS.

What is the essence of aligning a struct to a page?

View 10 Replies View Related

C++ :: Passing Page Request Via Php?

Sep 13, 2014

i want to write a c++ program that could pass a web page request, using a php script in a dns server. And also passed by the quested page to the software. What i really want to do is a software that can redirect a page request.

View 1 Replies View Related

C# :: Save Web Page To Database

Apr 10, 2014

What is the best way to save a c# web page to database, either sql or oledb both fine. What I am looking to do is save all the data that has been entered into a database then upload this data to a grid view or form view.

The problem is there is a a lot of data on the page. Such as drop down lists, check boxes panels text boxes. I am able to display the text boxes in the database when i enter information into them. this is not working for the other objects. Also there is fixed data in the panels which doesn't require user input but I still want this info saved as it is vital.

In short I want to save the data from a page ive created called DOCare.aspx into a database. then take the data and display it in Forms.aspx a different page, where it will list all the completed forms for the user to modify if needed.

How to do this or links to websites that have information on this?? Dont know if i am wording it wrong but just cant find a way to do this. Everyone ive seen is working with small amounts of data and only text boxes.

View 1 Replies View Related

C# :: How To Find Selected Tap Page

Aug 31, 2014

I have a secnario where I have few tab controls one ineide the other, where my real tab pages containing the data are 4 level deep. This entire structure is dynamically built from a data base.

Now I have a tick event, on whice I want to update the data in the currently selected tabpage.

How can I find it, recall that I have many tab controls, each has a tabpage with another tab control an so forth...

Two ideas I had in mind, I though I caould generate a list of all my data TabPages and itterate it, but I failed to find an indicator of the selected tab.

Another idea was to track the currently selected tabpage via an event, but I feared that I might miss somehow the track and my update the wrong tab page.

Last idea was really unelegant - Look at the main control, get the selected tab page, find the tab control on that page via searching its controls, than find this control selected page, and do the same until I reach the 4th level.

View 4 Replies View Related

C Sharp :: How To Set Printer For A Web Page

Sep 20, 2012

I have a test web page and a windows form which call a printer and sends a print job to a printer that is on the network. I have been able to successfully do this from the windows form, however, I can figure out how to do it from an aspx page to the server's default printer. Sample codes are below.

Windows Form:
  public partial class Form1 : Form   {
    private const string TEMPLATE_DIRECTORY = @"C:Program FilesBrother bPAC3 SDKTemplates";    // Template file path
    private const string TEMPLATE_SIMPLE = "NamePlate1.LBX";    // Template file name
    private const string TEMPLATE_FRAME = "NamePlate2.LBX";        // Template file name
    public Form1() {
      InitializeComponent();

[Code] ....

View 1 Replies View Related

C++ :: Reading Text In HTML Page

May 11, 2014

I am trying to make a simple c++ program that will read some text in the html page. Here is the source of the html i want to read.

<html>
<body>
This is a test message.
</body>
</html>

My expected result in c++ in an string array like this:

This
is
a
test
message

I tried to look around and I came across a function called InternetReadFile but I can't find any example similar to what I want.

View 7 Replies View Related

C# :: Printing Picture Not Come On Center Of Page?

Jun 11, 2014

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Bitmap myBitmap1 = new Bitmap(pictureBox1.Width,pictureBox1.Height);
pictureBox1.DrawToBitmap(myBitmap1, new Rectangle(0 , 0, pictureBox1.Width, pictureBox1.Height));
e.Graphics.DrawImage(myBitmap1, 0, 0);

[Code]...

when i print picture exist in picture box image come on top right why i need image come on center of page

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved