|
netJP12L wrote: testFolders1&Folder/
Parameters after '&' is considered as a Query String. Thus, in order to use it in a vald complete URL you need to encode your URL. As Mark suggested, URL.Encode would do this for you.
Encoding will convert this ampersand into it's html equivalent and thus will not make part of the text after it as query string.
|
|
|
|
|
I wanted to inform you that amperson Url encoding doesn't work for IIS 7. It worksin IIS 5 and 6.
|
|
|
|
|
|
I am new in .net world, i want to learn asp.net from starch to pro. Kindly recommend me some website URLs and books name about asp.net
Thanks
|
|
|
|
|
www.asp.net
and the best above all up and down is www.google.com
|
|
|
|
|
Try this: http://tinyurl.com/3yu4cek[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I'm having some problems getting my stored procedure to see th parameters I'm passing in. The parameters are retrieved from a web form, and seen to be successfully send to the data access tier, but when I run the code I get the following exception:
"Procedure or Function 'stbFormPropertiesToXML' expects parameter '@displayMode', which was not supplied. "
The code is:
DisplayMode = dMode;
FolderAlias = _folderAlias;
SqlConnection conn = new SqlConnection(@"Data Source= .;Initial Catalog=MXContact.NET_Demo_100401;Integrated Security=true;");
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "stbFormPropertiesToXML";
SqlDataAdapter frmDA = new SqlDataAdapter(cmd.CommandText, cmd.Connection);
DataSet FormPropertiesDS = new DataSet();
try
{
conn.Open();
cmd.Parameters.Add(new SqlParameter("@displayMode", SqlDbType.NVarChar));
cmd.Parameters["@displayMode"].Direction = ParameterDirection.Input;
cmd.Parameters.Add(new SqlParameter("@folderAlias", SqlDbType.NVarChar));
cmd.Parameters["@folderAlias"].Direction = ParameterDirection.Input;
cmd.Parameters["@displayMode"].Value = DisplayMode;
cmd.Parameters["@folderAlias"].Value = FolderAlias;
cmd.ExecuteNonQuery();
frmDA.Fill(FormPropertiesDS);
conn.Close();
FormPropertiesDS.WriteXml("FormProperties.xml");
}
catch (Exception ex)
{
errorMsg = ex.Message;
}
finally
{
conn.Close();
}
Where DisplayMode and FolderAlias are the parameters I'm trying to pass into the SP. The SP is defined as:
ALTER PROCEDURE [dbo].[stbFormPropertiesToXML]
@displayMode NVARCHAR(2),
@folderAlias NVARCHAR(30)
AS
SELECT *
FROM [stbFormProperties]
WHERE [FolderKey] = (SELECT [FolderKey] FROM [stbFolders] WHERE [FolderAlias] = @folderAlias)
AND [DisplayMode] = @displayMode
I've been eearching the web for articles for the past serveral hours; so a second pair of eyes would be a big help.
DRAYKKO
=======================
Every experience in life is a lesson to be learned
A. Stevens
B.S., Computer Science
|
|
|
|
|
You using the wrong method, cmd.ExecuteNonQuery(); is for commands like updates and inserts. You want to return data so need to use something like ExecuteReader. However, since you are using DataAdapater.Fill the call is not necessary at all.
Since SqlParameters are input by default it is not necessary to set it explicitly and the value can be set directly using
AddWithValue[^] so you eliminate a few lines.
Also, using SELECT * in a sql statement is a poor practice.
I know the language. I've read a book. - _Madmatt
modified on Tuesday, June 22, 2010 2:36 PM
|
|
|
|
|
Thanks for the prompt reply! I'll correct that...
DRAYKKO
=======================
Every experience in life is a lesson to be learned
A. Stevens
B.S., Computer Science
|
|
|
|
|
|
Hi All,
I have a tab control, within one tab of this tab control I want to have another tab control which contains 3 or 4 tabs in which I need to display some database bounded list boxes.
All the tabs in the two tab controls are static. They can be database bounded also.
Can anybody please help me in inserting a tab control in to another tab control. Any code snippet or any link will be very much helpfull.
Thanks in advance, I will be googling in this mean time. But pls. if possible pls. try to help me. I am using Telerik controls, any telerik and any Ajax controls are also Ok for me.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
indian143 wrote: I have a tab control, within one tab of this tab control I want to have another tab control
Tab inside a tab sounds a bad UI. It won't look nice and user interactive. It might confuse.
If needed, you should try using a tab in accordian or vice-versa. It would be clean and user's won't get confused.
|
|
|
|
|
I have some code that works correctly until I utilize a dynamic UpdatePanel to reduce flicker. I am trying to get a value from the parent page via javascript. This code works correctly without the UpdatePanel to get the current value of the hidden field. Once I add the UpdatePanel dynamically, it only ever returns the initial value of 0 from the hidden field. Any ideas?
Javascript in popup page (returns only iniital value of zero if I use UpdatePanel):
var x = window.parent.document.getElementById('ctl00$contentBody$hdnApplicationIndex').value
Parent page (the one that uses ModalPopupExtender to display popup):
<asp:HiddenField ID="hdnApplicationIndex" Value="0" runat="server" />
<asp:Button ID="btnHidden" runat="server" style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="mpeUser" runat="server"
CancelControlID="btnCancel"
OkControlID="btnOK"
TargetControlID="btnHidden"
PopupControlID="pnlUser"
PopupDragHandleControlID="pnlPopupHeader"
BackgroundCssClass="ModalPopup">
</ajaxToolkit:ModalPopupExtender>
<div id="pnlUser" style="display: none;height:600px;width:800px">
<asp:Panel runat="Server" ID="pnlPopupHeader" CssClass="PopupHeader">
User Search
</asp:Panel>
<iframe id="frmUserSearch" src="ModelUserSearch.aspx" scrolling="yes" style="height:100%;width:100%" frameborder="1">
</iframe>
<div style="display: none">
<input id="btnOK" onclick="ok();" type="button" value="OK" />
<input id="btnCancel" type="button" value="Cancel" />
</div>
</div>
Code-behind of parent page (happens during OnInit):
Button btnModelUser = new Button();
btnModelUser.ID = "btnModelUser_" + intAppIndex;
btnModelUser.Text = "Model User...";
btnModelUser.Click += new EventHandler(btnModelUser_Click);
UpdatePanel updModelUser = new UpdatePanel();
updModelUser.ID = "updModelUser_" + intAppIndex;
updModelUser.ContentTemplateContainer.Controls.Add(btnModelUser);
Table tblQuestions = new Table();
tblQuestions.ID = "tblQuestions_" + intAppIndex;
TableRow trModelUser = new TableRow();
trModelUser.ID = "trModelUser_" + intAppIndex;
TableCell tcModelUserButton = new TableCell();
tcModelUserButton.ID = "tcModelUserButton_" + intAppIndex;
tcModelUserButton.Controls.Add(updModelUser);
Here is where I change the value of the hidden field. Updated value is not retreived when I use the UpdatePanel:
protected void btnModelUser_Click(object sender, EventArgs e)
{
Button button = sender as Button;
int intIndexUnderscore = button.ID.IndexOf("_");
hdnApplicationIndex.Value = button.ID.Substring(intIndexUnderscore + 1);
mpeUser.Show();
}
|
|
|
|
|
You need to understand how UpdatePanel works. The hidden field, which is a poor design anyway, needs to be placed in the scope of the UpdatePanel for its value to available.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for your help. So what is a better way to get the ApplicationIndex value to be able to be accessed in the popup page? I will not know the value that needs to be set in ApplicationIndex until the user clicks one of the dynamically created buttons in the table on the page. The hidden field seemed like an easy solution, but I will have a problem if I have to set the ApplicationIndex value in a dynamically created control in the table. There would be one dynamic UpdatePanel per button and I would need to place the ApplicationIndex value in a control in the UpdatePanel. Therefore the popup panel code will not know which of the dynamically created controls to retrieve the value from.
Thanks.
Adam
|
|
|
|
|
Naptown Brown wrote: There would be one dynamic UpdatePanel per button
Why? Reuse the popup. Send the index to your page via a query string.
You should do some research on using JavaScript, JQuery has great support for modal dialogs. An UpdatePanel and button click postback aren't even necessary.
You should also learn to use the proper events. Button.Command allows you to set data such as the index number in the CommandEventArgs parameter rather than the cumbersome and slow string parsing you are trying to do.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
function PrintPage() {
printWindow = window.open("../xyz.pdf");
printWindow.print()
}
it's open the page but not print the page
|
|
|
|
|
jintalPatel wrote: printWindow.print()
Is not correct. Its an instance of open page.
window.print() is the command that works via JavaScript.
You are opening a PDF, so this might not work, had it been a webpage you could had done something like:
w=window.open('about:blank');
w.document.writeln("<script>");
w.document.writeln("window.print()");
w.document.writeln("</"+"script>");
|
|
|
|
|
Hi guys,
I am trying to load a text file into an iframe but I am keep getting an "Bad Request" error message. I couldn't figure it out where the problem is. Could anyone please help me up.
pathFile="https://www.mysupport.com/myhosted/Data/MainFolder/testFolders1&Folder/t.txt"
<iframe name="fraContent" id="fraContent" src="<%=pathFile%>" width=20% height=265 FRAMEBORDER="10">
</iframe>
Thanks in advance
|
|
|
|
|
function setframeOriginal(url)
{
var eyeframe;
eyeframe = document.getElementById('RSIFrame');
eyeframe.src='You Path';
}
;
|
|
|
|
|
Thanks for replying but are you saying that i should explicitly assign value through the javascript. Do you thin it will make a difference? While I was assigning to the "scr" value of iframe.
I have realized during a simple test that only those files get loaded where there is no & or ampersand sign in found in the file path. How should i deal with this issue.
Thanks again
modified on Tuesday, June 22, 2010 11:14 AM
|
|
|
|
|
Hi - Quick question
I want to have a page that when the user hits it for the first time they get asked what region they are from - eg, europe, usa or australia.
I am lookng to set a cookie based on what region the user has picked on my page - so that the next time they come to the site they dont have to choose and are redirected to the appropriate site. Does anyone know how this would be done?
Thanks for your help
|
|
|
|
|
Try this[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Don't cross post - you've asked this in Quick Answers as well (where you have a response).
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hello everybody.
I was requested to make an existing asp.net solution run on a test environment.
All the solution stuff is available on a SourceSafe server, but there are no .sln or .vbproj file in the repository.
As far as I guess, the solution is made up of a web application (*.aspx, *.vb, *.js, *.css, web.config, global.asax) and a web service (.asmx, *.vb). There are also folders and files regarding AJAX Control Toolkit.
The idea is to rebuild a .sln and two .vbproj files (one for the app, one for the web service), starting from an empty solution, adding manually all the file and creating all the references. But I fear this may be a long and tricky way.
Is there another way to rebuild the .sln or the .vbproj file?
Thanks,
Alberto
|
|
|
|