|
did the same but still object are null even i check it for control id they are same.
please help
imaran khan
|
|
|
|
|
FindControl() should return the control. Did you debug and check if the PlaceHolder contains the controls? Debug and check the id of the control's that are in the PlaceHolder .
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
You may need to call createcontrols() from Init rather than OnLoad. The problem is that on postback, the values in your checkboxes are saved in viewstate, which gets applied between Init and Load. If you wait until Load to create your controls, the viewstate won't be applied to them, and they'll lose their values.
|
|
|
|
|
i change the code and put it in Oninit as
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
createcontrols();
}
but still oject are null....
please help
imaran khan
|
|
|
|
|
My fix isn't for the problem you have (objects are null) but for the next problem you'll encounter (objects won't maintain values on if you dynamically create them too late in the page cycle).
The other solution posted to search the placeholder rather than the page for the controls should work, so I'm not sure what's wrong. I would use the debugger to inspect the contents of the placeholder's controls to see if anything is there.
|
|
|
|
|
I have aspx pages sitting in two different folders and both are mapped in virtual directory. I want to use response.redirect. How would I go about doing that?
|
|
|
|
|
Response.Redirect(Server.MapPath("FolderName\\FileName.aspx"));
I Love SQL
|
|
|
|
|
Edit: Bah. problem has been fixed.
--
Hi, I have a slight problem with getting records from a database.
The problem is simply when I use the following SQL string, it throws me up an error message.
Problem string:
"SELECT * FROM IDs WHERE id='2'"
However when I use this SQL string, it works.
Working SQL string:
"SELECT * FROM IDs WHERE name='bob'"
I have no idea why one is working and the other isn't. The only thing I could think of is a type mismatch (The id field is set to AutoNumber). I get the same error when trying to use both Strings and Integers.
Anyone have any ideas?
- Munty
-- modified at 10:20 Thursday 26th July, 2007
|
|
|
|
|
Muntyness wrote: it throws me up an error message
What error message it return?
I Love SQL
|
|
|
|
|
Ahhh goddammint!
I figured out what the problem was.
I was using "SELECT * FROM IDs WHERE id='2'" when I should have been using "SELECT * FROM IDs WHERE id=2".
|
|
|
|
|
Have you tried:
"SELECT * FROM IDs WHERE id=2"
|
|
|
|
|
Hello All,
Need your help with regards to SSO(Single Sign On). Lets say I have two websites A and B. After user logs on to A(login.aspx) user needs to go a say a default.aspx page and on Default.aspx, there is a button which on click should send the user to website B,(both websites are on the same domain..lets say a.abc.com and b.abc.com) as user is already logged on site A..it should directly send the user to welcome.aspx page on site B. Iam using form authentication. This is what i have in my web.config on both sites.
<authentication mode="Forms">
<forms name=".SSOAUTH" loginUrl="Login.aspx" protection="All" path="/" timeout="30"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<machineKey validationKey="1234567890" decryptionKey="9876543243" validation="SHA1"/>
On my site A login page, when user enters a login and password, i call a function and go against my DB and validate, if login and pwd match db, i return customerid and the code is as below:
Dim customerid As String = ValidateUser(txtUserName.Value, txtUserPass.Value)
If customerid <> "0" Then '--------Comment-if login is fine, customerid is never 0
Dim tkt As FormsAuthenticationTicket
Dim cookiestr As String
Dim ck As HttpCookie
tkt = New FormsAuthenticationTicket(1, txtUserName.Value, DateTime.Now, DateTime.Now.AddMinutes(30), True, "your custom data")
cookiestr = FormsAuthentication.Encrypt(tkt)
Session("FormData") = cookiestr '------Comment-saving in session for later use
Dim b As String = FormsAuthentication.FormsCookieName
Response.Cookies(b).Domain = .abc.com
Response.Cookies(b)("SiteA") = cookiestr
Response.Cookies(b).Expires = tkt.Expiration
Response.Cookies(b).Path = FormsAuthentication.FormsCookiePath
Response.Redirect("default.aspx")
Dim strRedirect As String
strRedirect = Request("ReturnURL")
If strRedirect <> "" Then
Response.Redirect(strRedirect, True)
Else
strRedirect = "Default.aspx"
Response.Redirect(strRedirect, True)
End If
Else
Response.Redirect("Login.aspx", True)
End If
My problem is it never redirects to Default.aspx on Site A... and from default.aspx on Site A..if i click a button..i need to it go to welcome.aspx on site B... for some weird reason though, it goes back to the login page..and further.. the cookie is set..its not reading it on site B. Please Help !! Any help is appreciated, where am i going wrong? code samples are much appreciated.
RH
|
|
|
|
|
I'm looking the code or codes of parameters in Crystal Report that I can access using C #. I appreciate your help.
|
|
|
|
|
|
with 'OWC .NET testpages demo app' depending on the option I select in:
'OWC demoss:
Scatter chart demo
OWC chart types
OWC chart with trendline and errorbars
I get 'could not load type: main.aspx
owctypes.aspx
trend.aspx
any ideas?
john
|
|
|
|
|
Hi ,
I am trying 3rd party authentication in my web application.
I am trying to use Google, Yahoo, AOL authentication providers. These authentication processes I am using to authenticate my application. I've done authentication for GMAIL.
In this authentication I've done following steps
1.Registered in GMAIL and mentioned destination page for remote authentication.
2.Used URL of Gmail authentication in my code and redirected to it
3.After entering correct credentials I retrieve TOKEN
4.Extract this TOKEN in destination page which I've mentioned in 1st step and with that Token I am calling Web service of GMAIL and retrieve User Details form it and showing on that page.
It is working fine for GOOGLE but from nowhere I am getting process/steps of how to use third party authentication for OPENID.
Please tell me if you know how to authenticate it.
Abhishek J
|
|
|
|
|
Hi All
I have created a folder which I want to rename through coding. If some knows the procedure then pls help me.
thanks in Advance.
|
|
|
|
|
Use the System.IO.Directory.Move or the System.IO.DirectoryInfo.MoveTo method.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I think the possible way to rename the folder is to delete the folder and create the new folder with the new name, before deleting the old folder we should move he contents of that folder to new folder.
Regards,
Sandeep Kumar.V
|
|
|
|
|
System.IO.DirectoryInfo dInfo = new System.IO.DirectoryInfo(Server.MapPath("1"));<br />
if (dInfo.Exists)<br />
{<br />
System.IO.Directory.Move(Server.MapPath("1"), Server.MapPath("2"));<br />
}<br />
I just tried it.Its working fine
Here "1" is folder name
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Thank u all of u, its realy helpfull. I have done my work. Once again thanks
|
|
|
|
|
Hello,
I’m writing a web application that needs to access other web applications. The pages that I need to access use both windows and forms authentication. I need to authenticate the users of my application without prompting for their password a username (they have a password and a username and I’ll use them to log in automatically).
I’ve already made this process for the applications that use forms authentication by making a POST request programmatically.
I need to do the same for the applications that I need to access that are using windows authentication, but I have no idea. Can anyone help me? Thanks.
|
|
|
|
|
how to create dynamic control in asp.net(on end user demand)
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
You can place a content place holder and add controls into that depending on user choice. But you won't be able to make this very generic solution. You should have an idea on the type of controls what user will add
|
|
|
|
|
thanks for reply
first time i do this type of work so which way we arrange control on the page.and how we transfer the information and etc have u any link or example
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|