|
Thanks a lot Ali Al Omairi(Abu AlHassan)..
Your solution works. Thank you so much.
|
|
|
|
|
|
Hi, please i need help on how to create downloadable xml form for user to fill in there information. then send it back to email or upload it back to the online web application.. Please have tried to use XSD with XML but i didn't get it right maybe am not doing the right thing. Please i need you help on this my professionals Thanks
<questionnaire>
<form>
<name>bob</name>
<action>process/RunForm.aspx</action>
<method>post</method>
</form>
<question>
<text>Full Name?</text>
<response>
<control>
<textbox>
<datatype>
<alpha>
<minlength>5</minlength>
<maxlength>30</maxlength>
</alpha>
</datatype>
<prompt>Full Name</prompt>
<required>true</required>
<password>false</password>
<default/>
<name>fullname</name>
<size>10</size>
<maxlength>30</maxlength>
</textbox>
</control>
</response>
</question>
<question>
<text>Password</text>
<response>
<control>
<textbox>
<datatype>
<any>
<minlength>8</minlength>
<maxlength>20</maxlength>
</any>
</datatype>
<prompt>Password</prompt>
<required>true</required>
<password>true</password>
<default/>
<name>password</name>
<size>10</size>
<maxlength>20</maxlength>
</textbox>
</control>
</response>
</question>
<question>
<text>How many pints do you drink each week?</text>
<response>
<control>
<textbox>
<datatype>
<numeric>
<minvalue>0</minvalue>
<maxvalue>120</maxvalue>
</numeric>
</datatype>
<prompt>Pints Consumed</prompt>
<required>true</required>
<password>false</password>
<default/>
<name>pints</name>
<size>3</size>
<maxlength>3</maxlength>
</textbox>
</control>
</response>
</question>
<question>
<text>What is irony?</text>
<response>
<control>
<textarea>
<prompt>Describe Irony</prompt>
<required>true</required>
<default>explain</default>
<name>irony</name>
<cols>20</cols>
<rows>4</rows>
</textarea>
</control>
</response>
</question>
<question>
<text>Date of birth?</text>
<response>
<control>
<textbox>
<datatype>
<date>
<format>dd/mmm/yyyy</format>
<usecalendar>true</usecalendar>
<separator>/</separator>
<mindate>13/feb/1974</mindate>
<maxdate>01/jan/2002</maxdate>
</date>
</datatype>
<prompt>Date of birth</prompt>
<required>false</required>
<password>false</password>
<default>dd/mmm/yyyy</default>
<name>dateofbirth</name>
<size>10</size>
<maxlength>12</maxlength>
</textbox>
</control>
</response>
</question>
<question>
<text>Driving Licence?</text>
<response>
<control>
<combo>
<prompt>Driving License</prompt>
<minselected>1</minselected>
<maxselected>1</maxselected>
<default/>
<name>drivinglicense</name>
<size>1</size>
<item display="choose" value=""/>
<item display="yes" value="1"/>
<item display="no" value="0"/>
</combo>
</control>
</response>
</question>
<question>
<text>Which women do you like?</text>
<response>
<control>
<radio>
<prompt>Women</prompt>
<required>true</required>
<default/>
<name>women</name>
<item display="blondes" value="blondes"/>
<item display="brunettes" value="brunettes"/>
<item display="gingers" value="gingers"/>
</radio>
</control>
</response>
</question>
<question>
<text>Which cars do you like to drive?</text>
<response>
<control>
<checkbox>
<prompt>Cars</prompt>
<name>cars</name>
<minchecked>2</minchecked>
<maxchecked>3</maxchecked>
<item display="ford" value="ford"/>
<item display="vauxhall" value="vauxhall"/>
<item display="toyota" value="toyota"/>
<item display="peugeot" value="peugeot"/>
</checkbox>
</control>
</response>
</question>
</questionnaire>
Larshittu
|
|
|
|
|
Infopath[^] has this functionality.
Otherwise you would need to create your application to render the XML into a usable form, serialize entered data and transmit back to you. Not to mention installing and supporting the application on the client systems.
Failure is not an option; it's the default selection.
|
|
|
|
|
Is your code sample suppose to be a XSD Template?, because it's not really a true xml document, and is not finished or complete as an XSD File. Your question is very vague to me, and I'm not sure why you included the code sample. But I can tell you that it would be cruel punishment to have to code to that.
Olanrewaju Matthew wrote: Please have tried to use XSD with XML but i didn't get it right maybe am not doing the right thing
This is a valid XSD file, which is a contact log. It has 5 string record fields, and is capable of generating an unlimited amount of records called ContactLog_Record.
You have to either create them from hand, or use a program that can model and test the results for you. The other valid ways to create an XSD file is to use the little program that comes in Visual Studio called xsd.exe, in which you can create a easy to use class to code to from an xsd file, or generate a xsd from a valid xml file, and then run it again to create the class.
="1.0"="utf-8"
<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns="" id="SignUp" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element msdata:IsDataSet="true" msdata:UseCurrentLocale="true" name="ContactLog">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="ContactLog_Record">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Email" type="xs:string" />
<xs:element name="Comment" type="xs:string" />
<xs:element name="IPAddress" type="xs:string" />
<xs:element name="MessageSubmission" type="xs:dateTime" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
So the output looks like this
="1.0"="utf-8"
<ContactLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///C:/Sep-WSDLS/ICE5%20Program%20XSD's/SignUp/footer_ContactLog.xsd">
<ContactLog_Record>
<Name>string</Name>
<Email>string</Email>
<Comment>string</Comment>
<IPAddress>string</IPAddress>
<MessageSubmission>1998-06-03T23:18:18.98</MessageSubmission>
</ContactLog_Record>
<ContactLog_Record>
<Name>string</Name>
<Email>string</Email>
<Comment>string</Comment>
<IPAddress>string</IPAddress>
<MessageSubmission>1970-11-20T15:19:13.26</MessageSubmission>
</ContactLog_Record>
<ContactLog_Record>
<Name>string</Name>
<Email>string</Email>
<Comment>string</Comment>
<IPAddress>string</IPAddress>
<MessageSubmission>1999-07-23T03:36:10.10</MessageSubmission>
</ContactLog_Record>
<ContactLog_Record>
<Name>string</Name>
<Email>string</Email>
<Comment>string</Comment>
<IPAddress>string</IPAddress>
<MessageSubmission>2011-04-05T22:49:54.79</MessageSubmission>
</ContactLog_Record>
<ContactLog_Record>
<Name>string</Name>
<Email>string</Email>
<Comment>string</Comment>
<IPAddress>string</IPAddress>
<MessageSubmission>2008-08-16T01:59:41.63</MessageSubmission>
</ContactLog_Record>
</ContactLog>
So my question to you is, could you perhaps just give more detail to the XSD issue first.
modified 25-Apr-12 13:31pm.
|
|
|
|
|
Thanks for your quick Response..
What am actually trying to do. is a downloadable form that the client goto our web apps or web site to download the form(Which am thinking of XSD or Pdf). After finishing filling the form the client will send it to our email. from email than insert the data field to Database or the client will upload it to direct from our Web app then that inserted to Database.
That is actually what i want to achieved from this Post...
Any sample Codefile be nice
Thanks
modified 27-Apr-12 7:54am.
|
|
|
|
|
Well call me old school, but I don't get it. So I'm going to let one of the younger guys help you out.
Here's my understanding, just a joke, don't take it serious, just a little humor today!
Let's say I want to play the Mega Millions Lotto, and the liquor store man hands me a XML form to put my numbers in. So I write the numbers into the spaces, and pay the man, and then he faxes them to Lotto Central.
<luckyNumber>2</luckyNumber>
<luckyNumber>4</luckyNumber>
<luckyNumber>36</luckyNumber>
<luckyNumber>41</luckyNumber>
<luckyNumber>45</luckyNumber>
<luckyNumber>48</luckyNumber>
|
|
|
|
|
i have to create a website using visual studio. i want to apply the same feature as it goes with the forums. user writes and submits the question. the question than saves in the database and when the administrator login he views the queries page. reply the answer to the particular query and when again user login he visits his query page and views the answer to his query..
plzz help..
thanks in advance.
Paulus
|
|
|
|
|
Paulus Kerketta wrote: plzz help..
So what exactly is the question?, and how does it relate to SQL Server?
There are already forum software packages written that you can either purchase, or are open source. You just have to find one that you like, download it, and load it in Visual Studio.
|
|
|
|
|
|
main motive is that i am creating an project on educational website in which a student logins and post his query related to his subject and that query should be saved in sql database. when the faculty of that particular subject logins, he should view the query section for the queries submitted by student and answer them. then again when student logins and visits the query section and he sees the answer replied by faculty. its should be just same as the forum section of this website.
|
|
|
|
|
I think in the future, perhaps just say the student logs in to ask a question, and the teacher logs in the provide the answer, then the student logs in to read the correct answer.
I would of quickly understood that.
Now that we have your intentions out of the way,
You should start with a designer, to help design how you want your forms to look and feel, then create a chart, order of operation, page flow chart, and then start writing code for it.
Lock down the user interface first, then start writing code for the mechanics of it like the database reads and writes. Login and security and so forth.
A snippet of code will not create your project.
There must be somebody at your office that has the complete vision.
|
|
|
|
|
For this you need to workout with both Front End (ASP.Net) as well as Back End (SQL).
Create two database tables one as UserMaster for Login User Details and other for Posts(Messages) as PostMaster having column for Posts, DateofPost, Status, PostedBy etc...
and when u click and save any new Post send the Login UserCode with query and save it in column PostedBy inPostMaster table and second thing is when any one logins to the Application check at login if the user is Admin or just normal user,,if it is Normal User then pick the data from PostMaster where PostedBy = LoginUser Code else in case if it is Admin then pick all data accordingly.
This is just the logic I give you..workaround with this..if stuck somewhere will discuss in next post from you.
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
dfffffffffffffffffffffffffffff
|
|
|
|
|
Hello,
There is a website that has some input boxes and after you enter the input you press a button and an answer shows up.
1) I am pretty sure that the website is in ASP, how can I be sure?
2) I want to make a windows application that behaves like the website, for the user it will have a specific MMI and to the internet it shell behave like I am working in the browser.
can anyone please give me a starting point?
Thanks
|
|
|
|
|
Look at the URL of that website: does it end with ".asp" or ".aspx"? Then it is an asp application. What you describe could also be achieved with JavaScript in an otherwise static html page, and of course you could do it also with php, cgi scripting, and other methods.
|
|
|
|
|
this is my code
<asp:Label ID="Label7" runat="server" BorderStyle="None" Width="80px" Text="Thumb URL" />
<asp:FileUpload ID="FileUpload1" runat="server" Width="200px" Filebytes='<%# Bind("thumbnail") %>' />
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" Display="Dynamic" ControlToValidate="FileUpload1" ErrorMessage="Required" /><br />
<asp:Label ID="Label8" runat="server" BorderStyle="None" Width="80px" Text="Image URL" />
<asp:FileUpload ID="FileUpload2" runat="server" Width="200px" Filebytes='<%# Bind("image") %>' /> /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" Display="Dynamic" ControlToValidate="FileUpload2" ErrorMessage="Required" /><br /><br />
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" Text="Update" />
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false" />
</EditItemTemplate>
|
|
|
|
|
I don't think that is legal with the Bind, I haven't used the FileUpload webform object in years, just from Code, FileBytes is a code property to get the total size of the upload on the server side.
<asp:FileUpload ID="FileUpload1" runat="server" Width="200px" Filebytes='<%# Bind("thumbnail") %>' />
<asp:FileUpload ID="FileUpload1" runat="server" Width="200px" />
|
|
|
|
|
Try removing the snippet Filebytes='<%# Bind("thumbnail") %>' from .aspx page and put it at .aspx.cs file where you are checking for the File Upload control has file or not..!
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
That's not going to work, Filebytes get the file uploaded as a stream or array of bytes, so you can write it as a blob, or do a direct write to the disk drive, or pass the stream to another server.
Gets an array of the bytes in a file that is specified by using a FileUpload control.
It's the other way around
Dim Input(fileLen - 1) As Byte
Input = FileUpload1.FileBytes
|
|
|
|
|
Hi,
I have listbox wich is dynamically updated with an AJAX call the declaration of the controls
<asp:DropDownList ID="lb_Retour" name="drp_Retour" runat="server">
</asp:DropDownList>
<asp:ListBox SelectionMode="Multiple" Height="160px" Width="300px" ID="lb_Info"
runat="server"></asp:ListBox>
In code behind i'm binding dropdownlist to datasource and adding OnChange Event to make an AJAX call with the function getvalues
protected void Page_Load(object sender, EventArgs e)
{
lb_Retour.DataSource = Ctx.Retours.OrderBy(n => n.Id).Select(n => n);
lb_Retour.DataTextField = "Retour";
lb_Retour.DataValueField = "Id";
lb_Retour.DataBind();
lb_Retour.Items.Insert(0, new ListItem("-Selectionner-", "0"));
lb_Retour.Attributes["onchange"] = "getValues(this);";
}
The javascript wich update the listbox values depending on dropdowlist selection
<script type="text/javascript">
function getValues(Control) {
var Code = Control.value;
if (Control.value.trim() != "")
$.ajax({
type: "POST",
url: "../Services/DomaineService.asmx/GetResponse",
data: "{ 'typeId': '" + Code + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
error: OnError
});
}
function OnSuccess(data, status) {
$('#ctl00_ContentPlaceHolder1_lb_Info').children().remove();
$('#ctl00_ContentPlaceHolder1_lb_Info').append(data.d.ValueList);
}
function OnError(request, status, error) {
alert(error.toString());
}
<script>
The data that returns the webservice is
<option value="1">toto</option><option value="2">titi</option><option value="3">tata</option>
below the Webservice Code
[WebMethod]
public ResponseInfo GetResponse(string typeId)
{
ResponseInfo xResponse = new ResponseInfo();
xResponse.ValueList ="";
PDataContext Ctx = new PDataContext();
var query = (from objInfo in Ctx.Infos
where objInfo.Type == Convert.ToInt32(typeId)
select objInfo
);
foreach (InfoComplementaire item in query.ToList())
{
xResponse.ValueList +="<option value=\""+item.Id.ToString()+"\">"+item.InfoComplementaire1.ToString()+"</option>";
}
return xResponse;
}
Well everthing is ok the values are update depending on selected on the dropdownlist the probem is when i try to select item in the list box in code behind i get nothing at all item.Selected is always false when the option values comes from the AJAX call!!
Thank you for help
|
|
|
|
|
That would be onClientClick to run javasccript before the page submits a postback
papy-boom wrote: The data that returns the webservice is
<option value="1">toto</option><option value="2">titi</option><option value="3">tata</option>
That's because you didn't include the selected attribute in the option tag when you wrote the new value in javascript.
Also, according to .net law, you can't populate a listbox or dropdown box in code behind, or from the server, and delete the values with javascript, and send the new selected value back to the server on postback, because the server has a temp list of the values it sent to the browser the first time, and it won't match the list on the postback.
You'll get nothing selected, because the original values are gone.
If your going to use javascript to populate the values via web service, you have to use an empty box, populate it, get the selection, send it back via web service,
|
|
|
|
|
Try by putting AutoPostBack property of DropDownlist set to "True"
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
I almost said that as well,
but you can't autopostback to the server if you use javascript / JQuery to wipe out the original list and create a new list from a web service, because the server retains the values it sent the first time, and expects one of those values to be selected.
If the value is not present, it will trigger a tamper or fraud error.
|
|
|
|
|
Hi,
I have a background image for my web page, that I have assigned in the load even the code behind.
Image is visible in the web page but that image in not printing when I print it. Can anybody please help me in resovling this issue pls.
Its little bit urgent. Thanks in advance.
In desing mode in html part Webpage
<body runat="server" id="rcbody">
<form id="form1" runat="server">
-------------------------
--------------------------
</form>
</body>
In the load event in the code behind is as in the below
if (Request.QueryString["status"] == "Cancelled")
{
rcbody.Attributes["style"] = "background-image:url('../images/Cancelled_WM.jpg');";
}
else if (Request.QueryString["status"] == "Replaced")
{
rcbody.Attributes["style"] = "background-image:url('../images/Replaced_WM.jpg');";
}
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|