|
Hi,
i have three asp.net applications in different domains say www.domain1.com and www.domain2.com and www.domain3.aspx.
Two pages are there in each applications .First LogIn.aspx and other MyPage.aspx. In mypage of www.domain1.com, i have a link to mypage.aspx of www.domain2.aspx and www.domain3.aspx. now my requiremets are:
1> when user login in www.domain1.aspx, and clicks any link on MyPage.aspx, say he clicks www.domain2.aspx, then he shud be redirected to Mypage.aspx of www.domain2.aspx. it shud not show him its login page .same for www.domain3.aspx.i have to use forms authentication.
Its basicly a single sign on.
The problem i am facing excatly is that, i acieved this using same machinekey,validationkey for all in web.config like
decryptionKey="F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902F8D923AC"
validation="SHA1" />
But i need that the validation keys should be different for different applicatons in there web.config ,and when i click the links from www.domain1.aspx then anyways i save it in the formauthetication cookie and also i want to add some more information in formauthentication cookie.
Please help me in this. Its urgent.Any other way to get this functionality achieved ia also welcome
thx
|
|
|
|
|
I get the "Object reference not set to an instance of an object." error. Any clues as to what is happening here?
Dim rdo As System.Web.UI.WebControls.RadioButtonList
For index As Integer = 1 To dtLevelC.Rows.Count
rdo = CType(Page.FindControl("RadioButtonList" & index), System.Web.UI.WebControls.RadioButtonList)
'Getting Rating Code from PFARatingCode DB
dtPFARatingCode = daPFARatingCode.GetDataByTableID(rdo.SelectedValue) If dtPFARatingCode.Rows.Count > 0 Then
Session("Rating") = dtPFARatingCode.Rows(0)("RationCode")
End If
..............
-- modified at 2:47 Monday 23rd July, 2007
|
|
|
|
|
Before using the rdo control check whether it is null or not!
It happens normally that the function gets called before the radio button gets loaded...
So Do a check on the rdo object before doing this!
BasharatAli wrote: dtPFARatingCode = daPFARatingCode.GetDataByTableID(rdo.SelectedValue) If dtPFARatingCode.Rows.Count > 0 Then
Session("Rating") = dtPFARatingCode.Rows(0)("RationCode")
End If
Hope that helps!!!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
i have already bind Page.FindControl("RadioButtonList" & index) with data source so why it's return nothing
|
|
|
|
|
Hi Basharat,Try posting your replies as replies thab answers or we wont be able to know whether youve replied or not..
Well first check out whether the radiobutton object button is giving the nullo reference exception or something else...
As u are using session objects its possible the seeion object is used before its getting initialized...
go through the code properly and try to figure out...
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
"Object reference not set to an instance of an object."
i'm getting this exception message before session object at this line of code
Dim rdo As System.Web.UI.WebControls.RadioButtonList
For index As Integer = 1 To dtLevelC.Rows.Count
rdo = CType(Me.FindControl("RadioButtonList1", 1), System.Web.UI.WebControls.RadioButtonList)
dtPFARatingCode = daPFARatingCode.GetDataByTableID(rdo.SelectedValue)<br />
If dtPFARatingCode.Rows.Count > 0 Then
|
|
|
|
|
Well im not sure wat ur problem is because.. but in my case i used to have this error because the line of code got called before the radio button got populated so..try giving the "if rdo is not null" kinda code before actually using the rdo object.
BasharatAli wrote: dtPFARatingCode = daPFARatingCode.GetDataByTableID(rdo.SelectedValue)
Not sure may be the radiobutton is hidden or its not able to find it coz of something!!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
okai thx sidbaruah
i know wat u r saying to check if null...
but my prob is why i'm gettion null because i hve already bound this Page.FindControl(RadioButtonList & index )with data source
any ways thx 4 ur time
|
|
|
|
|
I hosted one asp.net page and also bin directory,web.config and precompiledapp.config while deploying will get these files.i just add only two controls in that page one HTML Text box and one Asp Label Control but when i open that page i could see only the Html Text box, Label is not shown in that page.But when i check the source of this page i could see the Label and its Text.what is the problem. is there anything should i host. The webserver is windows server and it will support .Net Framework 2.0.
|
|
|
|
|
Is it showing any error??
|
|
|
|
|
It is not showing any Error.if we press once again the link in the browser it will show the HTML Code.
|
|
|
|
|
Have U written something in label?
Best regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
The Text of the Label is "Welcome" this is not showing
|
|
|
|
|
Hi friends!
Ive got a peculiar requirement!
Is it possible to add links to the reportviewer rows which will open a window displaying a set of data in a dataset..
Its possible to redirect to another page but how do i open another window?
if anyone has any ideas!!
Thanks in advance!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Yes you can add hyperlinks in rows in reportviewer. Unfortunately for you, I can't remember anymore where you can set this, but look for something called navigation / jump to url in the textbox options of the cell of your table.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Hi Thanks,
Well i know how to add hyperlinks but the problem is how to open a window out of the link click!
The link will redirect it to a new page while i wanted a pop up window on the click of the link !
thats wat is bugging me
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Hi all,
I have found a solution to upload multiple files in one click without a multiple file upload control. The solution is as follows,
1.Create a website with Default.aspx page.
2.Drag and drop controls ListBox and Button in the Default.aspx page.
3.Now go to Deafult.aspx.cs and add the following code,
using System;
using System.Drawing;
using System.Windows.Forms;
public partial class _Default : System.Web.UI.Page
{
public System.Windows.Forms.OpenFileDialog openFileDialog1
=new OpenFileDialog();
protected void btn_browse_Click(object sender, EventArgs e)
{
this.openFileDialog1.Multiselect = true;
openFileDialog1.ShowDialog();
string[] files = openFileDialog1.FileNames;
for (int i = 0; i < files.Length; i++)
{
lst_files.Items.Add(files[i]);
}
}
}
4.Press F5 to run the application.
5.Now you will be able to add the multiple files in the list box.
But my problem now is, how will i get the file contents and file name of the multiple files from the list box and updated into the database.
Could anyone of you help me out to solve this problem.
Thanks and Regards,
Hariharan C
|
|
|
|
|
Happy to see that finally you got a solution . Still your code is not digested for me, have you checked this somewhere other than your development system ? How you are getting contents in ListBox. Is it with full file path ?
I think you can loop on all list contents and get the file path. But problem will be reading file, since ASP.NET don't have permission to access the files location. If you are using your application on intranet, then manually you can add permissions for the directories, But in internet I don't think that this will be a good solution. I am not getting why your client is so specific on this type of uploads ? Have you seen something like this in any popular websites ? I never seen one .
|
|
|
|
|
Hi Navaneeth,
Now my requirement is, Can we assign a file name to file upload control by default.
Could you please help me on this.
Thanks and Regards,
Hariharan C
|
|
|
|
|
Hari_1010 wrote: Now my requirement is, Can we assign a file name to file upload control by default.
I think you can't
|
|
|
|
|
ok thanks Navaneeth
Thanks and Regards,
Hariharan C
|
|
|
|
|
Hi,
In one of my test ASP.NET 1.1 app I am trying to implement caching in one of the page (Default.aspx). I have implemented following directive
<%@ OutputCache Duration="600" VaryByParam="None" %> in my Default.aspx page. This page contains 1 Text Box & 1 Button. I type some stuff (lets say Hello World) in the textbox & redirect user to Default2.aspx page by clicking on the button.
In my Default2.aspx page I have an button which redirects user to Default.aspx page. When I am being redirected to Default.aspx page, Hello World is not being shown in Textbox.
Kindly let me know that is there anything that I need to implement extra in <%@ OutputCache Duration="600" VaryByParam="None" %> directive or some logic needs to be written in Default.aspx.vb code behind file?
Thanks in advance.
Regards,
Vipul Mehta
Regards,
Vipul Mehta
Sr. Software Engineer
|
|
|
|
|
Vipul Mehta wrote: In my Default2.aspx page I have an button which redirects user to Default.aspx page. When I am being redirected to Default.aspx page, Hello World is not being shown in Textbox.
I don't find any issue with caching here. This looks like you are not familiar with caching concept. Say you have texbox and button on default.aspx. And user is typing something in textbox. Where you are storing that value ? Without storing that value you are redirecting to other page. If you come back to the original page, that value will be cleared since you are not loading it when page loads.
Caching is used to speed up the ASPX page performance. OutPutCaching caches the page output and updates the cache in the specified duration. To test caching you need to store the user entered value some where and load in page_load to textbox. You can see this value won't be updated immediately, it will be updated when ASP.NET updates page cache again.
|
|
|
|
|
Dear All,
I am making web application using Asp.net C#(Visual Studio2005).
I have checkboxlist(which is populated by all the master filed like category , subcategory ,customer , etc ). Now based on selection I generates web control label (to name the field) and dropdownlistbox (which is filled by code and its description).
My problem is all controls comes one after other. I would like label then dropdownlist in a single line. That custlabel and its dropdownlist comes in one line then next say categorylabel and its dropdownlistbox should align in next line and inbetween them one free line .
My code is
foreach (ListItem li in CheckBoxListmst.Items)
{
if (li.Selected == true)
{
//code added to fetch dropdownlist
setting = ConfigurationManager.ConnectionStrings["StyleSearchConnectionString"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
cmd = new SqlCommand("Search_display");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cateid", SqlDbType.VarChar);
cmd.Parameters["@cateid"].Value = li.Text.ToString();
conn.Open();
cmd.Connection = conn;
try
{
// added controls
Label label = new Label();
DropDownList dropdownlist = new DropDownList();
label.ID = "label" + li.Text;
dropdownlist.ID = "dropdownlist" + li.Text;
label.Text = li.Text;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
ListItem ld = new ListItem();
ld.Text = rdr["disp"].ToString();
ld.Value = rdr["mstid"].ToString();
dropdownlist.Items.Add(ld);
}
PlaceHolder1.Controls.Add(label);
PlaceHolder1.Controls.Add(dropdownlist);
Response.Write(" ");
//added controls end
}
catch (SqlException ex)
{
}
Please Guide me or atleast give some help full link.
thanks
imaran khan
|
|
|
|
|
I was wondering if there's an equivalent 'include'-type method for asp.net pages
(like php's include "incFolder/header.php" which includes the header on each page).
I have a master page, with a contentPlaceHolder (CPH). In the CPH, I load each page. However, there's a section of (html) code that I'd like to be able to include at certain places WITHIN the CPH (ie. the individual pages).
Can individual pages also reference some sort of cph's themselves? (this would be awesome).
Scenario:
- - - - - -
masterPage.master:
<br />
asp: contentplaceholder id=myCPH . . . . asp: contentplaceholder<br />
- - - - - - - - -
- - - - - - -
MyCPH:
<br />
Hello world this is my page<br />
<br />
HERE I want to include a generic block of code to be used in individual CPH's<br />
<br />
more myCPH stuff...blah blah blah...<br />
- - - - - - - - - - - - - - - - -
Any help much appreciated,
Gerry
aps.net newbie
|
|
|
|